How to number lines in internal FAR editor? FAR itself, plugin, macro?
Example before:
Hello world,
how are you?
What is the weather today?
Example after:
01 Hello world,
02 how are you?
03 What is the weather today?
How to number lines in internal FAR editor
-
- Posts: 6820
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 528 times
Re: How to number lines in internal FAR editor
If you mean "virtual numbering", that is, line numbers are only indicated but not physically present in the text, then I don't know of any plugin or macro that can do that.
If you mean real inserting the numbers into editor lines, then almost any search and replace plugin can do that (and it is also easy to do with a macro).
Example with LuaFAR Search plugin:
Search for:
Replace with:
Example with LuaFAR for Editor plugin (Process Lines utility):
Expression:
If you mean real inserting the numbers into editor lines, then almost any search and replace plugin can do that (and it is also easy to do with a macro).
Example with LuaFAR Search plugin:
Search for:
^
Replace with:
\R{1,2}
(there is a space in the end that BBCode deletes)Example with LuaFAR for Editor plugin (Process Lines utility):
Expression:
("%02d "):format(N)..L
-
- Posts: 129
- Joined: Sun 08 Jan, 2012 08:23
- Location: Czech Republic
- Has thanked: 2 times
- Been thanked: 1 time
Re: How to number lines in internal FAR editor
Hello Shmuel, I meant real inserting the numbers. LuaFAR for editor did the job best, even with leading zeros. Thank you.
And may I ask one more question for LuaFAR for editor?
I can see that sorting lines is possible. But I have to set some expression. But what expression? For example I need only sort selected lines by its first letters.
And may I ask one more question for LuaFAR for editor?
I can see that sorting lines is possible. But I have to set some expression. But what expression? For example I need only sort selected lines by its first letters.
-
- Posts: 6820
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 528 times
Re: How to number lines in internal FAR editor
Expressions are described in Help (press F1 while the dialog is displayed).KlepetoX wrote:I can see that sorting lines is possible. But I have to set some expression. But what expression? For example I need only sort selected lines by its first letters.
To sort only by the 1-st letter, ignoring others, the expression is:
a:sub(1,1)
.