Emergency bailout: :q! :q!:q! vi Modes of Operation: --- --- Neutral Commands: i : Takes you into insert(edit) mode, all new keypresses go into file : leave edit mode x : Delete character under the cursor, line content shifts left dd : Delete line under cursor, remaining content shifts up ( cut ) d45d : Delete 45 lines, starting at line cursor is on ( cut ) dNd : Delete N lines ( cut ) yy : Yank ( copy ) line under cursor yNy : Yank N lines p : Put ( paste ) contents of yank buffer starting on line after cursor P : Put starting on line ABOVE cursor u : Undo - undoes the last COMMAND : Redo last undone command . : Repeat last command /pattern : Search for 'pattern' within the file n : Jump to next match of current search pattern N : Jump to prev match Cursor Movement: You _can_ use the cursor keys.... But you shouldn't get into that habit. :) h,j,k,l is preferred: h: left j: down k: up l: right : page forward ( down ) : page backward ( up ) G: Jump to the last line in the file 56G: Jump to line 56 NG: Jump to line N Ed Commands: :q : Quit :q! : [Force] Quit, without saving changes :w : Write ( save ) :wq : Write and quit :x : Exit ( write and quit )