Vim Editor Commands
Vim Editor Commands
There are two modes in vim. One is the command mode and another is the insert mode.
In the command mode, user can move around the file, delete text, etc.
From command mode to insert mode type a/A/i/I/o/O ( see details below)
o Open up a new line following the current line and add text there
O Open up a new line in front of the current line and add text there
^U Up half screenful
Exit Commands
: 10,25 w temp
write lines 10 through 25 into file named temp. Of course, other line
numbers can be used. (Use :f to find out the line numbers you want.
x Delete character
dd Delete line
U Restore line
To create a page break, while in the insert mode, press the CTRL key
And l. ^L will appear in your text and will cause the printer to start
A new page.
pat2
Example :g/tIO/s//Ada.Text_IO/g
This will find and replace tIO by Ada.text_IO everywhere in the file.
Examples
Step 1 type vim filename (edit the existing file named filename)
Step 2 move around the file using h/j/k/l key or any appropriate command
Step 4 hit Esc key (exit from insert mode if you insert or replace text)