esc- for normal modei- for insert mode:w- write the file (save):q- quit the file:wqor:x- write and quit:q!- quit without writingh,j,k,l- Basic navigationh- rightj- downk- upl- down
a- append nextI- insert before lineA- append after lineo- new line belowO- new line above
w- next wordb- previous wordW- next word (ignore special characters)B- next word (ignore special characters)r- replace letter (replace a character without going insert mode)R- replace a word (replace a word without going insert mode)cw- change word8w- jump eight wordsc7w- change seven words4j- move four lines downC- change rest of the linedw- delete wordD- Delete rest of the lined4w- delete four linesdd- delete line (deletes the whole line where ever the cursor is)cc- change line (changes the whole line where ever the cursor is)4dd- change four lines8cc- change 8 linesx- delete a character (without going insert mode)
u- for undoctrl + r- redoctrl + u- undo in insert modeciw- change in inner wordci"- change in " "diw- delete in inner word (in the middle of the word delete without going to the first character)da"- cut whole text in any positionJ- deletes an empty line (without going insert mode)P- inserts an empty line (without going insert mode)ci)/]/}- change inner parenthesis/bracketsdi)/]/}- delete inner parenthesis/brackets%- jump to the parenthesis/brackets^- Jump to the first of the linegg- jump to the beginning of the lineG- jump to the end of the line17G- go to line 17:17- go to line 170- navigate to the beginning of the line$- navigate to the end of the line
v- enter visual moded- deletec- changey- yanking (copying)Y- yank immediately without going visual modep- paste afterP- paste beforeyy- yank line5yy- yank 5 lines9p- paste nine timesy5w- yank 5 wordsyi)- yank in inner bracketsyiw- yank in inner words
V- visual linectrl + v- Visual blockdot(.)- repeat last operationzz- center selection>- shift right<- shift left=- indent>>&<<- indent==- indent linegg=G- indent whole fileggdG- delete the whole file
:lsor:buffers— List buffers:e <file>- open file in new buffer:bnext/:bn— Next buffer:bprevious/:bp— Previous buffer:b <num>— Go to buffer by number:bd— Delete (close) buffer
:split/:sp— Horizontal split:vsplit/:vsp— Vertical splitCtrl + w h/j/k/l— Move between splitsCtrl + w q— Close current splitCtrl + w =— Equalize split sizes:resize +5— Increase height:vertical resize +10— Increase width
/word- search for wordn- next occurrenceN- previous occurrence+- next token occurrence#- previous token occurrence:s/old/new- replace:%s/old/new/g- replace everywhere:set number/nu- line numbers:set relativenumbers/rnu- relative numbers:colorscheme <theme>- select theme:set tabstop=4- tab width to 4:set autoindent- auto indentation:set mouse=a- activate mouse:set mouse=""- deactivate mouse