> > >
vim /path/to/file +10 open with line numbervim /path/to/file +/pattern open with patternvim /path/to/file +LspInfo open with commandvim -p file1 file2 ... open with tabvim -o file1 file2 ... open with splitvim -O file1 file2 ... open with vsplit:e edit:w write:q quit:saveas save as file:noautocmd w write without running autocommands:help keyword helpv visualV visual linec-v visual blocki insert beforeI insert at the head of linegi insert to last editing placegI insert in column 1a insert afterA insert at the end of lineo insert next lineO insert previous liner replacex erases erase and enter insert modeu undoU undo allc-r redoy yankp paste~ switch casec-a add numberc-x subtract number<< shift line leftwards>> shift line rightwards= syntax indentJ remove newline char. repeat last command:move +1 :move -1 move line:[range]copy. :[range]t. copy line 10 and paste:changes print change listc correctd deletey yank (copy)g~ switch casegu to lowergU to upperi innera “a”t tillw words sentencep paragrapht tag block[ ( { parenthesesb “(“blockB “{“block< > ” 'yy yank linecc correct linedd delete lineY default is equal to yy, but to make it consistent, map it with y$C correct all after cursorD delete all after cursorc-a last inserted textc-n next wordc-p previous wordc-u erase linec-w erase wordc-y copy character abovec-e copy character belowc-r invoke registerc-vI// or #Escc-x c-] tag completionc-x c-f file completionc-x c-l line completionc-x c-p c-x c-n context-aware word completionc-x c-o language-aware completionh leftj downk upl rightw word forwardb word backwarde forward to the end of wordge backward to the end of wordgE backward to the end of WORD0 first character of the line^ first non-blank character of the line$ last character of the linegg top of fileG end of file% go to matched parenthesesfx Fx find next xtx Tx find till next x; repeat last f or t[[ ]] section forward/backward{ } paragraph forward/backwardg; g, jump change forward/backwardz. cursor move as centerzt cursor move as topzb cursor move as bottomc-u scroll up one pagec-f scroll down one linec-y scroll up one pagec-e scroll down one linec-f open command historyc-c close command history# search currenct word/ search input word? search input word from bottom/<xxx/> match whole word of “xxx”:%/s/src/dst replace “src” with “dst”:%/s/src/dst/g replace all “src” with “dst”:%/s/src/dst/c replace “src” with “dst”, with confirmation:g/pattern/d remove lines matching pattern:g!/pattern/d remove lines that do NOT match pattern:v/pattern/d remove lines that do NOT match pattern:%s/\s\+$// remove trailing spaces:%s/pattern//n count pattern occurance:bdelete:bNext :bprevious:split :vsplitc-w r swap window right/downc-w R swap window left/upc-w h c-w j c-w k c-w l move cursorc-w H c-w J c-w K c-w L move windowc-w o close all other windowsc-w f split file under cursorc-w H change split to horizontalc-w K change split to vertical:tabedit edit with tabgt next tabgT previous tab:copen :lopen:cNext :cprevious:ccloseqa record “a” macro@a execute “a” macrog Commandsg C-g count wordsga ASCII codegv reselect visualgn next search pattern with visually selectiong8 print hex value in UTF-8gw format and wrapgx open with browserg? Rot13 encodinggd gD go to definitiongm go to middle of screen linegM go to middle of text linegs go to sleep:bufdo:tabdo:cdo:cfdo:ldo:lfdo:args :argdoctrl+] jump to definitionctrl+o jump back]n go to next conflict marker[n go to previous conflict marker:ab abbreviations:set scrollbind scroll splits simultaneously:!sh echo $PATH execute shell:read /path/to/file read a file:read !date read a date:read !date +\%s read a timestamp:mksession! /path/to/session.vim make sessionvim -S /path/to/session.vim start with session