[Ilugc] help: vi editor - to insert new line

  • From: zulfilee@xxxxxxxxxxxxx (zulfilee)
  • Date: Wed Jan 5 10:55:07 2005

Hi,
Just go to command mode
Type
:map k o^[j

The ^[ is ctrl+v ctrl+[ combination

Now keep pressing k and the new lines get added.

Also if you want one keystroke use this
:map k o^[jk
Now press k once 

Cheers
Z
On Wednesday 05 January 2005 10:09, carti wrote:

Hi,
I want to insert new line(empty line) at the end of
every line in vi editor.

To be more clearer,
How to insert "tab"(\t as in c programming) and
"newline"(\n as in c programming) through  the
substitution command(1,$s/oldtext/newtext/g).

I have given the sample of original and the modified
text at the end.

Thanks and regards,
carti

P.S: Google did not come to my rescue

Eg:
<original.txt>
line one
line two
line three

<after_replacing.txt>
line one

line two

line three


_______________________________________________
To unsubscribe, email ilugc-request@xxxxxxxxxxxxx with
"unsubscribe <password> <address>"
in the subject or body of the message.
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

-- 
The highest sounds are hardest to hear. 
Going forward is a way to retreat. 
Great talent shows itself late in life. 
Even a perfect program still has bugs
                  -Tao of programming

Other related posts: