Vim commands quickref
Move cursor
h and l : Left and Right. k and j : Up and Down.
Basic Edit
i: enter insert mode, cursor is before the highlighted character. a: enter insert mode, cursor is after the highlighted character.
:wq: save and quit. :q!: quit and do not save.
Delete and Undo
x: delete the current highlighted character.
d: delete. Its basic format is d
motion: w: move cursor to the next word’s first letter. e: move cursor to the current word’s last letter. $: move cursor to the end of this line.
then Delete Operation: dw: delete until cursor get to the first letter of the next character. d2e: do {delete until deleted the end of the current letter} twice. … … dd: delete the whole line (and put it into the register).
u: undo.
U: undo all the operations to this line.
Paste and Change
p: add things in register after the current cursor.
r
c: change. It has the same format with d. cw: delete from cursor to the end of this word, and enter insert mode.
Locate and File status
Search and Replace
/
External Command
:!
File Operation
:w
Open and Append
o: open a line below the cursor line. O: open a line above the cursor line. R: enter replace mode. y: copy. p: paste. yw: copy a word.
Set
:set
#Quickref #vim