Shortcut

VI Short Cut

Command Action Command Action
ma mark the location (a~z) (after blocking) :norm i/;!c#/ comment out for many lines
‘a go to the marked location (a~z) ^z & fg (in shell) exit & back
`` go to previous cursor (after blocking) zf make folding
zo, zO, zR open folding zc, zm, zM close folding
!}fmt -100 fix the width of 100 in the paragraph g Ctrl+g word count
:bel sp (or) :bot sp horizontal split and edit bottom :bel vsp (or) :rigthtb vsp vertical split and edit right
^w n +(-) n larger (smaller) in horizontal window ^w n >(<) n larger (smaller) in vertical window
^w arrow switch window ^w= set the same size in window
:Hexplore[!] Horizontal Split & Explore directory of current file :Vexplore[!] Vertical Split & Explore
after assigning blocks from visual block option (by "v" at execute mode)
:’<,'> norm i <something> (or x) insert <something> to multiple lines <something> can be just space by typing space
(or delete for 'x')
Move action
H top z<CR> current line to top
M middle z. current line to middle
L bottom z- current line to bottom
[n]H n-th line of the window Ctrl+b scroll up a window
Ctrl+u scroll up half window Ctrl+f scroll down a window
Ctrl+d scroll down half window G very end
gg, 1G very first [n]G nth line
Pattern
:s/old/new/g<CR> change all <old> to <new> in current line
:1,20s/old/new/g<CR> change all <old> to <new> in 1st line to 20th line
:-2,+4s/old/new/g<CR> change all <old> to <new> in before 2 lines to after 4 lines from current point
:%s/old/new/gc<CR> change all <old> to <new> for all lines with check
:.,$s/old/new/gc<CR> change all <old> to <new> from current line to last line
:m,n (range of m-n) :. (current line) :$ (last line) :% (all lines)
:g/pattern/s/old/new/g<CR> change all <old> to <new> in the line containing the pattern
Spell
:set spell <CR> set up spell :set nospell <CR> cancel spell configuration
zg, zG add the word to good one zw, zW add the word to wrong one
]s move to next bad word [s move to previous bad word
Vimdiff
]c next difference [c previous difference
do diff obtain dp diff put
:diffupdate re-scan the files for differences

Linux Short Cut

ls -d */ ls only directory

Jupyter (iPython) Short Cut

hotkeys.png