command inital state cancel partial command vi states \------\ with ESC /------/ insert \---------/ last line enter with | enter with a i o c s | : / ? end with | end with ESC | RET | _____________________ ______________________ _______________________________ | | \ CHANGE \ / DELETE / | INSERT | \ cw word \ / dw word / | a after cursor yankword yw | \ cc line \ / dd line / | A at end of line yankline yy | \ C rest of line \ / D rest of line / | i before cursor put p | \ s under cursor \ / x under cursor / | I at beginning of line | \ S same as cc \ / X before cursor / | o open line below | \ r replace char. \/ xp transpose / | O open line above | \__________________________________ / |______________________________| \ MOVE / | | \ k line up scroll down ^D / | ex COMMANDS | \ j line down word forward w / | :se nu set numbers | \ l right space word backward b / | :se nonu no numbers | \ h left space end of word e / | :r file read in file | \ 0 beginning of line / | :!cmd run cmd | \ $ end of line line n nG / | :se wm=10 Wrap words | \ G end of file / |_______________________| \______________________/ | | \ OTHER / | SAVE/QUIT | \ u undo change / | | \ . repeat / vi commands | :w write buffer | \ / find down / | :q quit | \ ? find up / | :wq write and quit | \ n next / | :q! abandon buffer | \ / | :ZZ same as :wq | \ / | :^Z suspend VI | \ / | | \ / | | -- |_______________________|