Basic Vim Motions
Things to remember.
Modes:
i- insert modeesc- normal modev/V- visual mode:- command mode
Motions:
h,j,k,l0- home,^- first chr,$- eolw/W- next worde/E- next word-endb/B- backward
Insert mode:
i- insert before chrI- beginning of linea- append after chrA- EOL
Horsing around:
zz/zt/zb- scroll rel cursorH/M/L- jump to first/mid/last line on screenZZ- quick exit
Text modification:
d- deletedd- delete lineD- delete till EOLdiw- "delete in word"ciw- "change in word" (delete word + INS)x- delete chrr- replace.- replay
Clipboard:
y- yankyy- yank linep- paste before,P- paste after"1y- yank to register 1"1p- paste from register 1"+y/"+p- system clipboard"%p- current file name*- select current word matches →n/N- jump to next/prevviw- select word
Macros:
q1- record macro to reg 1q- stop recording@1- replay macro
Time travel:
u- undoCtrl+r- redo
Commands:
:w - save
:q/:q! - quit
:noh - reset search highlights
:%s//NEW/gc - replace *-selected substring with confirmation
:reg - show registers