Table of Contents

Vi

edit

concept

2 modes

Quit

navigation esc; then shortcut
cursor place h (left) j (down) k (up) l (right)
line start/end home / end
go to line 78 :78
display cmd
show line number :set number
off line number :set nu!
hex mode :%!xxd
exit hex %!xxd -r
function cmd
replace char r
delete char/line x / dd
paste shift+p
find :/wordToFind
find next/previous n / N
replace once on current line :s/OLD/NEW
replace all on current line :s/OLD/NEW/g
replace all in range line :#,#s/OLD/NEW/g (. for current line, $ for end line, 78 for line 78)
replace all in file :%s/OLD/NEW/g

cheat sheet