Vim Commands
- 1 minCommands
command | function |
---|---|
vim -O [filename1] [filename2] | open file1 & file2 simultaneously and split horizontally |
vim -o [filename1] [fliename2] | open file 1 & file 2 simultaneously and split vertically |
:s/old/new | replace old string with new string for the first case in the line |
:s/old/new/g | replace old string with new string for every case in the line |
:%s/old/new/g | replace old string with new string for every case in the file |
Shortcuts
key | function |
---|---|
u | undo |
ctrl+r | redo |
Multi-line Operations
Block Insert
-
Ctrl+v: select multiple lines
-
I (capital i): insert mode
-
insert the words
-
Esc: after several seconds, the words are inserted to all selected lines
Block Delete
-
Ctrl+v: select contents in multiple lines (with j, i, k and l)
-
d: delete the selected contents