I don't write code much anymore. But I use Lemmy editor to edit documents. Works very well.
Edro 6 months ago
Thank you thank you thank you!
for a line of:
a b c
(tab character is in-between letters)
a command of:
s/ /\n/g
yields:
anbnc
However
for the line:
a b c
(tab character is in-between letters)
a command of:
s/ /^v^m/g
(the ^v doesn't appear as Cliff pointed out)
yields:
a
b
c
which is what I want! Cliff is correct.
Thank you!!
Stephen Slot Odgaard Last year
I have used Lemmy as my goto VI editor for the past 30 years or so. Don't need anything else.
Edro 7 months ago
Me, too. Windows 10 can't open the ,hlp file. Does anyone know how to express a NL (new line) in a regular expression in this vi? Usually I would do this:
:g/\//s//\NL/g
(with NL hitting the return)
That would change all '/' into new lines.
Useful after a:
$ find . -type f -a -print > filelist.lxt
Anyone?
Cliff 6 months ago
Edro,
New line should just be \n.
So, your command should read:
:g/\//s//\n/g
Cliff 6 months ago
And, I'm clearly confused. \n is the match for a newline. If you want to put a newline into the substitution, use CTRL-V, then CTRL-M.
The CTRL-V isn't visible, but tells the editor to accept the next character as a character, not to interpret it. The final command will look like:
:g/\/s//^M/g
Edro 6 months ago
Cliff,
Thank you thank you thank you!
for a line of:
a b c
(tab character is in-between letters)
a command of:
s/ /\n/g
yields:
anbnc
However
for the line:
a b c
(tab character is in-between letters)
a command of:
s/ /^v^m/g
(the ^v doesn't appear as Cliff pointed out)
yields:
a
b
c
which is what I want! Cliff is correct.
Thank you!!
I don't write code much anymore. But I use Lemmy editor to edit documents. Works very well.
Thank you thank you thank you! for a line of: a b c (tab character is in-between letters) a command of: s/ /\n/g yields: anbnc However for the line: a b c (tab character is in-between letters) a command of: s/ /^v^m/g (the ^v doesn't appear as Cliff pointed out) yields: a b c which is what I want! Cliff is correct. Thank you!!
I have used Lemmy as my goto VI editor for the past 30 years or so. Don't need anything else.
Me, too. Windows 10 can't open the ,hlp file. Does anyone know how to express a NL (new line) in a regular expression in this vi? Usually I would do this: :g/\//s//\NL/g (with NL hitting the return) That would change all '/' into new lines. Useful after a: $ find . -type f -a -print > filelist.lxt Anyone?
Edro, New line should just be \n. So, your command should read: :g/\//s//\n/g
And, I'm clearly confused. \n is the match for a newline. If you want to put a newline into the substitution, use CTRL-V, then CTRL-M. The CTRL-V isn't visible, but tells the editor to accept the next character as a character, not to interpret it. The final command will look like: :g/\/s//^M/g
Cliff, Thank you thank you thank you! for a line of: a b c (tab character is in-between letters) a command of: s/ /\n/g yields: anbnc However for the line: a b c (tab character is in-between letters) a command of: s/ /^v^m/g (the ^v doesn't appear as Cliff pointed out) yields: a b c which is what I want! Cliff is correct. Thank you!!