(1) Begin vi : begin vi +-------+ +---------+ +---------+ | Input | <- a,i,o -- | Command | <-- : --- | Ex Mode | | Mode | --- ESC --> | Mode | --- : --> | | +-------+ +---------+ +---------+ (2) End (Ex Mode) :wq : write and quit :w : write :q! : quit no-save :q : quit (3) Editing (Input Mode) a : input after cursor A : input at the end of line i : input before cursor I : input at the head of line o : input in new line below cursor O : input in new line above cursor r : replace a character at cursor R : overwrite from cursor o : input in new line below cursor x : cut characters dw : cut words dd : cut lines and store them in buffer D : cut to the end of line yy : copy lines p : paste after cursor (line) P : paste after cursor (line) s : substitute the characters starting from : the current cursor position by u : undo . : rddo ESC : input end (4) Cursor Movement (Command Mode) C-b : 1 page up C-u : 1/2 page up k : 1 line up h : 1 char left l : 1 char right b : 1 word left w : 1 word right e : word end 0 : 1st column ^ : 1st word $ : end of line j : 1 line down C-d : 1/2 page down C-f : 1 page down G : go to G : go to the last line (5) Search (Command Mode) / : search forward ? : search backward n : next after cursor N : next before cursor (6) Editing in Ex Mode (:) [range]command[line] range = n[,m] : line n (to m) n = . : current line m = $ : last line = % : all lines = none : current line command = m : move range after line = t : copy range after line = d : delete range [range]s/string1/string2/[gc] : string substitution g = global c = interactive (7) Customization in Ex Mode (:) set [no][option] e.g.) set showmode set noshowmode set number set nonumber set autoindent set noautoindent