v: characterShift+v: whole lineCtrl+v: cursor, multiple lines
h,j,k,lf{c}: move toccharacter (useful for characters which would otherwise mess with/regex search:.,,,;,:, etc.)t{c}: same asf{c}, but before theccharacterF{c}: andT{c}are moving backwardsw: from word to wordb: likew, but backwardse: end of wordge: likee, but backwards{,}: move paragraph up/down0: move to the beginning of the line^: move to the first character of the line$: move to end of linegg: top of the fileG: bottom of the filezz: center screenzt: put cursor on topzb: put cursor on bottom
gd: go to definitiongf: jump to file in an import``: jump between 2 last lines, useful when jumping b/n variable definitions and usage lower in the fileCtrl+0/I: jump back and forth of lines in history
/{pattern}: go to specific word (nrepeats)%: find a matching({[]})*: go to next occurrence of the word under the cursor#: go to previous occurrence of the word under the cursor
o: open a line below cursorO: open a line above cursora: after cursorA: at the end of a lineI: at the start of a line
Follow the (zone) selection pattern <action>a<object> or <action>i<object>
- text within a tag:
vit - all with the tag:
vat - mark a word:
vaw - text within
():vib - all with
():vab - text within
{}:viB - all with
{}:vaB
Others
- add to selection:
gb(similar toCtrl + D)
Follow the (zone) deletion pattern <action>a<object> or <action>i<object>
Others
- entire line:
dd nlines:ndd, i.e.3dd- word:
dw - until character:
dtc, wherecis the char - until end of line:
D,d$ - character under cursor:
x - character before cursor:
X
- undo:
u - redo:
Ctrl+R - repeat last change:
.
Regular expressions are supported
r: character beneath cursorR: enter replace mode:s/old/new/g: entire line:#,#s/old/new/g: line numbers:%s/old/new/g: entire file:%s/old/new/gc: entire file with a prompt
Ctrl+ [p|n]: autocomplete