|
||||
MOVEMENT << Horizontal >> ->, l right-one character <-, h left one character 0 beginning of line $ end of line w / W beginning of next word / bigword e / E end of next word / bigword b / B beginning of prev. word / bigword ( / ) beginning of prev. / next sentence { / } beginning of current / next paragraph MOVEMENT ^^ Vertical vv UpArrow, k up one line DnArrow, j down one line PgUp, ^B up one page PgDn, ^P down one page numberG goto line number /string find string n / N search next / search prev. |
OPEN, SAVE + QUIT :q quit :q! quit without saving the changes :w filename save as filename :x save and quit |
|||
WINDOWING (Vim/Elvis) :sp filename new split-frame window ^w^w goto next window |
||||
THESE COMMANDS MODIFY TEXT in ex mode X delete character under cursor J join next line to end of current line rchar replace char under cursor char dd delete current line dmove delete from corpus to move U undo . repeat last edit command |
||||
INSERT MODE Any of these commands -> will put you in insert mode. In insert mode, you can type in text, hit return for a new line, <-, v, ->, ^ to move and Delete. To return to command mode, hit Esc. |
i / a insert before / after corpus I / A insert at beginning / end of line o / O new line below / above, then insert cc replace current line cmove replace to move |
|||
COMPOUND COMMANDS - the power of Vi
|
||||
VISUAL MODE (vim/elvis)
|
SEARCH / REPLACE in ex mode :s/RegExp/Replace. 1st match current line :s/RegExp/Replace./g all matches cur. line :%s/RegExp/Replace./g global replace :%s/RegExp/Replace./gc global with prompt |