Forum Replies Created
- AuthorPosts
- StefanParticipant
Hi Bob, welcome.
BB> if there is a config specifically for apex?
I think not.
You can take an look yourself at > Library > Syntax Files.
But maybe someone will jump in and share his config?But please note that you can modify
an existent config to your needs
if you know the details of APEX:menu “Tools > Select Configuration > Define Configurations…”
For example
* select the XML configuration and press [Copy]
* Rename the copied config by entering “APEX”
* Press the [Properties] button for fine tuning.Once you are satisfied you may want to share them with us?
See your “eeConfig.ini”StefanParticipantYou can sort by column in EmEditor
while you are in “Separated Values” mode.1.)
Therefor you have to delimiter your columns first by either
* one tab (t) => TSV mode
* one coma (,) => CSV mode
* one own delimiter => DSV mode ( e.g. one “:” or “|” or “;” or one space ” ” or…)Hint: For your examples
RegEx Search for three-or-more spaces
and replace by an coma:
Find: s{3,}
Replace: ,
[X] Use Regular Expressions
Now you have CSV.2.)
Next switch to delimiter mode via
menu “Edit > Separated Values/Sort > selecting-your-mode”For your case use CSV if you have followed the s&r tip.
Hint: you must seen some thin vertical lines.
3.)
Then click into an column and use an Sort mode.Explanation:
CSV means “Coma Separate Value” and you
must have an coma between your columns.
There must be NO coma inside the column itself!TSV means “Tabulator Separated Value”
and the same is valid as said for CSV.DSV means “Defined(by user) Separated Value”
and you have to set the delimiter yourself
e.g to ‘;’ or ‘|’ or something like that.
To setup the DSV delimiter go to menu
“Tools > Properties for X”
and at the [File] tab
set the “Delimiter [; ]”Since spaces can sophisticate the sorting
be sure to have no, or at least the same
amount of spaces around your delimiter.
(Your example lines have uneven amount
of spaces between the columns)Please note that you can also right click
the ruler to get the “Separated Value” menu.HTH?
For more read the help or visit
http://www.emeditor.com/modules/feature1/rewrite/tc_35.html#csv
http://www.emeditor.com/modules/tutorials4/index.php?id=35StefanParticipantDon’t know,
but maybe “Tools > Plug-ins > Open Documents”
could be an handy feature for your issue?.
StefanParticipantUpps :-o
F8 works already as needed
for my suggestions No.1 and No.2 from my initial post above!
(It’s even kinda “sticky selection” (No. 3), but not really)How to:
– press F8 to set the starting point of an selection
– now use one (or more) of this movements:* Ctrl+G GoTo e.g. Line 34
* Ctrl+F Find e.g. an word or an sign.
Or RegEx ^$ to find next blank line (select paragraph)
Tip: Even F3 works after F8. (e.g. Ctrl+F8 ,then F3)* F2 go to next bookmark
* Shift+F2 go to prev bookmark* use Arrow keys
* or just click somewhere else
And voila, all between is selected now.
You can even extent the selection by using
the same or an another moving command again.There are some more F8 commands:
* Select Character command – F8
* Select Line command – CTRL+F8
* Select Vertically command – CTRL+Shift+F8
(it’s a little bit tricky with bookmarks, but works:
– press CTRL+Shift+F8
– select the wanted columns at the first line
– be sure to remember the end column number at the right(e.g.: 35)
– go to next boomark (F2)
– the selection line is at column 1 (the selection is
at the left side of the start column.)
– use now Ctrl+G to go to the remembered column ’35’ in this example.
Or just use the right arrow key.)Read more about in the help:
EmEditor Help – Command Reference – Edit categoryHTH?
EDIT
Sure enough, of course now i find this info everywhere:f.ex. here:
EmEditor Help – How to – Edit > To Select a Portion of a Document
Click at the beginning of the selection, move the mouse to the end of the selection while holding the left mouse button down, and then release the mouse button.
Tips
Alternatively, press arrow keys while pressing the SHIFT key.
Alternatively, press the F8 key, and then press arrow keys.
To select lines, click on the left edge of the window, or press CTRL + F8.
To select vertically (in a rectangular block), use the mouse to select while pressing the ALT key, or press SHIFT+ CTRL + F8.And here >
http://www.emeditor.com/modules/newbb/viewtopic.php?topic_id=669&forum=2StefanParticipantuser wrote:
how do I enter the “EmEditor” command in context menu, because it’s missing now
thanks!
If one would use the help > Search tab: search for “context”
One would find:
– Dialog Boxes
– Customize dialog box (found e.g. at Tools menu)
– Shortcut tab
– [More Shortcuts…]
[X] Add a shortcut to the Context Menu on Explorer check box.
StefanParticipantAgain seen an use for this.
IF
we get “Sticky Selection”
AND
an Shortcut to Start an Selection / End the Selection
THEN
it would be nice to also get
an shortcut to duplicate an selection :-Dimagine this work flow:
– type something
– “Start an Selection”
– type ABC
– “End the Selection”
– enable “Sticky Selection”
– type something
– duplicate the selection
(which is ABC here only, but can be an larger string also).
StefanParticipantIf you will implement this improvement (Arrow and Home/End keys can move vertical line)
for the zero-width selection mode……then i have an another suggestion to make the creating
of that vertical selection line more easy (for handicapped users)– make an normal line selection
– press an hotkey like Ctrl+Shift+L (or use an menu command) to switch to zero-width selection modeThat way there is an zero-width selection created at pos. 0 on all before selected lines.
Now we can use the arrow or end -key to move the vertical line.
.
May 16, 2012 at 11:49 am in reply to: delete all lines that match any of the regexes that are in a txt file #10361StefanParticipantHaving e.g. “c:tempnumbers.txt” with one number at each line.
c:tempnumbers.txt:
123
222
345Use an code like this to read this file into an array.
Then use a FOR loop to process each array indices (0 till highest index)
and inside the FOR loop use the current index to do what you want.
// 1.) helper code to read an files content
//Your file with the numbers, each at an own line:
NumbFile = "c:tempnumbers.txt";
//============================================
fso = new ActiveXObject("Scripting.FileSystemObject");
oFile = fso.OpenTextFile(NumbFile, 1, false, 0);
content = oFile.ReadAll();
oFile.Close();
fso = null;
//alert(content);
//============================================
// 2.) the needed code itself
//For Each Line In Lines Do:
LinesArray = content.split("n");
for (LineNumb = 0; LineNumb < LinesArray.length; LineNumb++){
//do here what you want...
bAnswer = confirm( LinesArray[LineNumb] );
if (bAnswer == false){break;}
}
For more about Javascript FileSystemObject and text files read e.g.:
http://www.ezineasp.net/post/Javascript-FSO-OpenTextFile-Method.aspxStefanParticipantI think that’s commonly called “Code Folding” (or “Text folding”)
And it is called Outline by EmEditor.
EmEditor Help – How to – Plug-ins – Use Outline Plug-in
The Outline plug-in is installed by default with EmEditor Professional.
There are two major functions in this plug-in:
1.) Outlining in the custom bar
A tree view appears when you click the on the Plug-ins bar.
Or on the Tools menu, point to Plug-ins, and then click Outline.
In the Outline custom bar, the outline appears as a tree.
…2.) …
[To customize the plugin] right-click on the Outline button on the Plug-ins bar, select Properties, …
Find me: “Code Folding” “CodeFolding” “Code-Folding” “Code-Faltung” “Text folding” “Textfolding” “Text-folding”
From Wikipedia, the free encyclopedia
Code folding is a feature of some text editors, source code editors and IDEs that allows the user to selectively hide
and display sections of a currently-edited file as a part of routine edit operations. This allows the user to manage
large amounts of text while viewing only those subsections of the text that are specifically relevant at any given time..
May 15, 2012 at 5:16 pm in reply to: delete all lines that match any of the regexes that are in a txt file #10357StefanParticipantIf it allowed to match ANY number between ‘918’ and ‘1884’ ?
Then try:
for ( Numb = 918; Numb <= 1884; Numb++){
document.selection.Replace("^" + Numb + ".*$", "", eeFindNext
| eeFindReplaceRegExp | eeReplaceAll);
}
Or the showed numbers only?
.
StefanParticipantSeen again:
“Sticky Selection” is also nifty
if your macro/script do an selection
and you want to move around in the
document to see the start or end
of the selection.Therefor alone it would be nice to
have an command “Sticky Selection”
as last command in your macro..
StefanParticipantIn the meantime i can help me with an macro.
– find/go to the wanted start position for the selection.
– set an bookmark (toggle: Ctrl+F2).
– find/go to the end position of the wanted selection.
– execute this macro:o = document.selection;
EndLine = o.GetActivePointY( eePosLogical );
document.selection.PreviousBookmark();
o.SetActivePoint( eePosLogical, 1, EndLine, true );The same but wiith explanations:
////Returns the line number of the cursor position:
yPosEndLine = document.selection.GetActivePointY( eePosLogical );
////Goes to the previous bookmark in this document:
document.selection.PreviousBookmark();
////Sets the cursor position:
////bExtend: Optional. Determines whether to extend the current selection.
////If bExtend is true, then the active end of the selection moves to
////the location while the anchor end remains where it is.
////Otherwise, both ends are moved to the specified location.
bExtend = true;
xPos = 1;
document.selection.SetActivePoint( eePosLogical, xPos, yPosEndLine, bExtend );
StefanParticipantThe same (and more) as pop-up menu:
For example you can just press “Ctrl+Alt+M” + a
to “Remove empty lines (incl. whitespace) – in Selection”As explained here
http://www.emeditor.com/modules/newbb/viewtopic.php?viewmode=flat&topic_id=1879&forum=19you can create your own menu in EmEditor, here e.g. an pop-up menu.
To create your own pop-up menu follow this steps:
1. Copy the below code into EmEditor and Save as e.g. myMenu.jsee
2. Execute menu “Macros > Select This” to add this macro to My Macros
3. Assign an keyboard shortcut to launch this pop-up menu
// Tools > Properties for all configurations > [Keyboard]
// Category: My Macros
// Commands: myMenu.jsee
// Press new shortcut key: e.g. Ctrl+Alt+M
// [Assign]
// [OK]Now do:
– open an test file
– make an selection or press Ctrl+A
– e.g. press “Ctrl+Alt+M a” to “Remove empty lines (incl. whitespace) – in Selection”Here is the macro code:
//EmEditor TextApe :-)
//v0.01, 14. Mai 2012, Stefan, First tests
//v0.02, 15. Mai 2012, Stefan, First public beta release
//v0.03, 22. Mai 2012, Stefan, Wording: Blanks>Whitespace, some optimizations
//Found at:
//http://www.emeditor.com/modules/newbb/viewtopic.php?topic_id=2033&forum=19&post_id=6625#forumpost6625
//Initial work:
init();
//Build the menu:
TextApe=CreatePopupMenu();
TextApe.Add("&A Remove empty lines (incl. whitespace)",1);
TextApe.Add("&B Remove empty lines",2);
TextApe.Add("&C Reduce many empty lines to one (incl. ws)",3);
TextApe.Add( "", 0, eeMenuSeparator );
TextApe.Add("&D Reduce many whitespace to one",31);
TextApe.Add("&E Remove every whitespace",32);
TextApe.Add("&F Remove leading whitespace",33);
TextApe.Add("&G Remove trailing whitespace",34);
TextApe.Add("&H Remove lead+trail whitespace",35);
TextApe.Add("&i Remove first sign (any)",36);
TextApe.Add("&J Remove first sign (non-blank)",37);
TextApe.Add("&K Remove any of this signs in front...",38);
TextApe.Add("&L Remove last sign (any)",39);
TextApe.Add( "", 0, eeMenuSeparator );
TextApe.Add("&M Insert in front...",61);
TextApe.Add("&N Insert in front... of first sign",62);
TextApe.Add("&O Insert to the end...",63);
TextApe.Add("&P Enclose selection...",64);
TextApe.Add("&Q Enclose each line...",65);
TextApe.Add( "", 0, eeMenuSeparator );
TextApe.Add("About",1000);
//Get which item was clicked:
var vClickedItem = TextApe.Track();
//Execute the related code block:
switch(vClickedItem)
{
case 1:
//Remove empty lines (incl. whitespace) - in Selection
document.selection.Replace("^s*n","",eeFindNext | eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
break;
case 2:
//Remove really empty lines only - in Selection
document.selection.Replace("^n","",eeFindNext | eeReplaceAll | eeReplaceSelOnly | eeFindReplaceRegExp);
break;
case 3:
//Reduce many empty lines to one (incl. ws) - in Selection
document.selection.Replace("^s+$","",eeFindNext | eeReplaceAll | eeReplaceSelOnly | eeFindReplaceRegExp);
document.selection.Replace("n{2,}","nn",eeFindNext | eeReplaceAll | eeReplaceSelOnly | eeFindReplaceRegExp);
break;
case 31:
//Reduce many whitespace to one - in Selection
document.selection.Replace("s{2,}"," ",eeFindNext | eeFindReplaceEscSeq | eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
break;
case 32:
//Remove every whitespace - in Selection
document.selection.Replace("s+","",eeFindNext | eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
end();
break;
case 33:
//Remove leading whitespace - in Selection
document.selection.Replace("^s+","",eeFindNext | eeReplaceAll | eeReplaceSelOnly | eeFindReplaceRegExp);
break;
case 34:
//Remove trailing whitespace - in Selection
document.selection.Replace("s+$","",eeFindNext | eeReplaceAll | eeReplaceSelOnly | eeFindReplaceRegExp);
break;
case 35:
//Remove leading + trailing whitespace - in Selection
document.selection.Replace("^s*(.+?)s*$","$1",eeFindNext | eeReplaceAll | eeReplaceSelOnly | eeFindReplaceRegExp);
break;
case 36:
//Remove first sign from selected lines
document.selection.Replace("^.","", eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
end();
break;
case 37:
//Remove first non-blank sign from selected lines
document.selection.Replace("^(s*).(.+)$","$1$2", eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
break;
case 38:
//Remove any of this signs in front of line - in Selection
RemoveAnyOfThisSigns();
break;
case 39:
//Remove last sign from selected lines
document.selection.Replace(".$","", eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
break;
case 61:
//Insert in front of selected lines
Leader = prompt("What to insert in front?","// ");
document.selection.Replace("^",Leader, eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
break;
case 62:
//Insert in front of first non-empty - in selected lines
Leader = prompt("What to insert in front?","// ");
document.selection.Replace("^(s*)(.)","$1"+Leader+"$2", eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
break;
case 63:
//Insert to the end of selected lines
Trailer = prompt("What to insert to the end?"," //");
document.selection.Replace("$",Trailer, eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
break;
case 64:
//Enclose selected word
mySign = prompt( "Enter sign to enclose selection:", "\%" );
selText = document.selection.Text;
document.selection.Text = mySign + selText + mySign;
break;
case 65:
//Enclose each selected line
mySign = prompt( "Enter sign to enclose selection:", "\%" );
document.selection.Replace("^(.*)$",mySign+"$1"+mySign, eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
break;
case 1000:
alert("EmEditor TextApe :-)nv0.03, 22. Mai 2012nnJust some nifty macros.nEnjoy!nnStefan");
break;
default:
break;
}
//Some bigger or maybe common used function:
function init(){
if(document.selection.IsEmpty){
alert("This macros works with an selection only.n
Please make an selection first, then call this menu again.");
quit();}
redraw = false;
}
function RemoveAnyOfThisSigns(){
Signs = prompt("What to delete in front?",">-*,+");
if (Signs.indexOf("-") > -1){
Signs = Signs.replace("-",""); Signs = Signs + "-";}
for (i=1;i<10;i++){
document.selection.Replace("^(s*)[+Signs+]+","$1",eeFindNext
| eeReplaceAll | eeReplaceSelOnly | eeFindReplaceRegExp);
}
}
function end(){document.HighlightFind = false;}
//<EOF>
StefanParticipantuser wrote:
great thanks!how do I count the instances of a match and store the amount in a variable?
Do the RegEx s&r with an macro.
For example i have found that this
JavaScript macro could be an base for your issue:
//select your text, then execute the macro
if (document.selection.IsEmpty){alert('Nothing selected?'); quit();}
SelText = document.selection.text;
alert(SelText); // <== only for testing
//Settings:
MatchREx = "(.+?t).+t(NOT SENT|SENT)"; //Match/Find this
ReplWith = "$1$2"; //Replace with that
REModify = "gi"; //(G)lobal, (i)gnor case, (M)ultiline
//How many matches?
Matches = SelText.match(RegExp(MatchREx,REModify)).length;
//Do the RegEx search&replace itself:
ReplacedStr = SelText.replace(RegExp(MatchREx,REModify),ReplWith);
//The output:
alert(Matches + ' matches found'); // <== only for testing
alert(ReplacedStr); // <== only for testing
//Overwrite the selected text:
//document.selection.text = ReplacedStr;
StefanParticipantHi Michael, welcome.
Maybe you should post one or two example lines
and your “before” and “after” solutions.From interest is too which version of EmEditor you use.
Perhaps even the new betas?.
StefanParticipantuser wrote:
FROM:
GROUP1{TAB}IT{TAB}EM1{TAB}SENT
GROUP1{TAB}I{TAB}TE M2{TAB}SENT
GROUP2{TAB}IT E M3{TAB}SENT
GROUP2{TAB}ITE{TAB}M4{TAB}NOT SENT
GROUP2{TAB}ITEM5{TAB}SENTTO:
GROUP1{TAB}SENT
GROUP2{TAB}NOT SENTTry (with an copy of your file!)
this RegEx search & replace:FIND: (.+?t).+t(NOT SENT|SENT)
REPL: $1$2
[X] Use Regular ExpressionsExplanation:
(.+?t) = match and store all non-greedy till the first TAB into group $1
.+ = match all, but only till:
t(NOT SENT|SENT) = an TAB followed by “not sent” OR “sent”, which ever is stored in $2.
StefanParticipantThanks webern, but that doesn’t explains why it works in one version and not in the other.
Anyway, i have now understood that i doesn’t need the part
o.SetActivePoint(eePosLogical, 1, yPosEnd, true);and also not the part
yPosEnd = o.GetActivePointY(eePosLogical);New version:
// Shorten the object string, just for fewer typing:
o = document.selection;
// - - -
// Find something backwards/up, here empty line:
o.Find("^s*$",eeFindPrevious | eeFindReplaceRegExp);
// Remember the current line number:
yPosBegin = o.GetActivePointY(eePosLogical) +1;
// - - -
// Find again something downwards
// (here: find an blank line, non-greedy)
// AND move the cursor that way to the found position :
o.Find("^s*$",eeFindNext | eeFindReplaceRegExp);
// Do an selection.
// Set the start of the selection to the remembered line.
// The end of the selection will be the current line:
o.SetAnchorPoint(eePosLogical, 1, yPosBegin);
Similar i use now this to just select down
to the next blank line:
o = document.selection;
//Remember the current line number:
yPos = o.GetActivePointY( eePosLogical );
//Move cursor to found position (here: find an blank line):
o.Find("^$",eeFindNext | eeFindReplaceRegExp);
//Do an selection.
//Set the start of the selection to the remembered line:
o.SetAnchorPoint( eePosLogical, 1, yPos );
.
StefanParticipantAbout
EmEditor Professional 10 New Features
http://www.emeditor.com/modules/feature1/rewrite/tc_36.html#numberingI want to suggest to add an option “[X]Skip empty lines”
To get
001 Line of code xxyxyxc
002 Line of code xxyxyxc003 Line of code xxyxyxc
004 Line of code xxyxyxc005 Line of code xxyxyxc
006 Line of code xxyxyxc
007 Line of code xxyxyxcinstaed of
001 Line of code xxyxyxc
002 Line of code xxyxyxc
003
004 Line of code xxyxyxc
005 Line of code xxyxyxc
006
007 Line of code xxyxyxc
008 Line of code xxyxyxc
009 Line of code xxyxyxcThank You.
StefanParticipant1.)
I would also like to be able
to move the zero-width vertical selection ( | )
with the left/right arrow keys
to modify several columns
without the need to do an selection again and again.One,| Two= Three.
One,| Two= Three.
One,| Two= Three.One Two=| Three.
One Two=| Three.
One Two=| Three.One Two Three.|
One Two Three.|
One Two Three.|One Two Three
One Two Three
One Two ThreeWould be nice if even Pos1- and End-keys would be working
and move the vertical selection to begin or end of the line.
Where i then can use the arrow keys to move the vertical selection.EmEditor Professional 8 New Features
Vertical selection of zero width:
http://www.emeditor.com/modules/feature1/rewrite/tc_7.html#vertical_selection_editing2.)
Improved Vertical Selection Editing:
EmEditor Professional 10 New Features
Vertical selection of zero width at the right
of the end of lines will cause the selection to move
to the end of each line in the selection.
http://www.emeditor.com/modules/feature1/rewrite/tc_36.html#improved_vertical_editingNice and useful feature!
But how can make an vertical selection at the right
without getting this new effect?
IOW: how can i add vertical align text to the right as before?Never mind. Found it:
Make an normal vertical column block selection (Ctrl+Shift+F8)Thank you.
StefanParticipantSalabim: it’s done when it’s done.
Your post is not that polite, but maybe it’s your skill in english language?StefanParticipantmguttman wrote:
Isn’t Tools -> Import and export… what you are looking for?Thanks, but no, because that belongs to the whole EE settings.
I want to export just “My Menu”.
But all is hidden in the settings in binary code :-(
Would be nice to have clear text like with VIM or Total Commander.With VIM i can even have the config for “my menu” in an separate text file
and load it in run time to the main menu,
just at that time i need it. (think different menus for different tasks)StefanParticipantEdit to add:
The same suggestion for the “Assign keyboard shortcut” option:
Please add a new category “Load Macro” as described above.
.
StefanParticipantI had forgotten that this is a new feature
and so i used it very self-evident in the 11.1.x betas
to double existing items for an start for an new macro.And it works very well.
Not only to copy&paste items.
I even can paste plain text and get an new snippet item.Back in 11.0.5 i quickly miss this feature badly :-D
SO thanks again Yutaka, well done!
.
StefanParticipantThanks for the link! :-)
That seems to be an old need for many.
I still wonder why such basics are not in the Edit menu.Meanwhile i got an Problem:
My last macro was developed
with “Head-start version v11.1.7 beta”And there it works fine. Even with the line
o.SetActivePoint(eePosLogical, 1, yPosEnd, True);On THIS pc i tested it now with 11.0.5
and got an problem:If i use the above line
o.SetActivePoint(eePosLogical, 1, yPosEnd, True);
then the “True” is not highlighted
because it has to be lower case. OK. Fine.But, the script is working with that Upper case True.
But then, after the selecting is done,
i got the message: (“True is not defined”)OK, i can change it to lower case “true”
o.SetActivePoint(eePosLogical, 1, yPosEnd, true);The true is highlighted now,
but the script does not work anymore.
It seems it do something, but nothing is selected.Where is the bug? :-D
Update, checked again:
with v11.1.7 beta only the upper case “True” works too.
There is no message as with 11.0.5 after the selection.
If i change to lower case “true”, the word is highlighted
but the script does not work here too. Only with “True”.StefanParticipantShorter code, but takes more time due the use of regular expression:
// language = "JavaScript"
// Select whole paragraph macro.
// An paragraph is an block of text delimited by two empty lines.
// How to:
// 1. Have the cursor inside an paragraph.
// 2. execute this macro.
o = document.selection;
o.Find("^s*$",eeFindPrevious | eeFindReplaceRegExp);
yPosBeg = o.GetActivePointY(eePosLogical) +1;
o.Find("^s*$",eeFindNext | eeFindReplaceRegExp);
yPosEnd = o.GetActivePointY(eePosLogical);
o.SetAnchorPoint(eePosLogical, 1, yPosBeg);
o.SetActivePoint(eePosLogical, 1, yPosEnd, True);
- AuthorPosts