"Important ones" (read: those I'm likely to forget, but are yet usefel ;) < Delete indention (on range, visual, motion) > Insert indention "[\w\d] Use register [\w\d] for next yank, put, change ga Show ASCII value of character under cursor gg Goto first line :e Edit :enew New file zf New fold over zo Open fold zi Inverse 'foldenable' Every command/keycombo can be prefixed by a number, indicating the number of times the command gets executed. COMMAND MODE ^e Scroll forward one line ^y Scroll backward one line ^d Scroll down half a page ^u Scroll up half a page ^f Scroll forward one page ^b Scroll backward one page ^ Go to beginning of line (discard whitespace) 0 Go to column 0 $ Go to end of line w Move forward one word W Move forward one word (separated by whitespace) b Move backward one word B Move backward one word (separated by whitespace) e Move forward one word, putting cursor on end of word E Move forward one word, putting cursor on end of word (separated by whitespace) ge Move backward one word, putting cursor on end of word gE Move backward one word, putting cursor on end of word (separated by whitespace) g Move a character on screen (on same linenumber of long paragraph) C Change characters after cursor r Replace current char with x Delete current character ~ Change case u Undo ^r Redo dd Delete line dw Delete word daw Delete an entire word d$ Delete till end of line D Delete till end of line d0 Delete till beginning of line d^ Delete till beginning of line (discard whitespace) d/regex Delete till regex occurs dab Delete a ()-block daB Delete a {}-block dib Delete in ()-block, except the () diB Delete in {}-block, except the {} p Paste after cursor/line P Paste before cursor/line yy Yank line . Repeat last command v Visual mode V Visual line mode Ctrl+V Visual block mode i Insert text a Append text I Insert text at beginning of line A Append text at end of line R Replace text J Join lines gJ Join lines without adjusting spaces zt Move current line to top of screen zz Move current line to middle of screen zb Move current line to bottom of screen ##z(\n|\.|-) Move line number ## to top, middle or bottom of screen H Move to top line on screen M Move to middle line on screen L Move to bottom line on screen #H Move # lines below top line on screen #L Move # lines above bottom line on screen + Move to first character of next line - Move to first character of previous line #| Go to column # of current line / Search forward ? Search backward n Repeat search in same direction N Repeat search in opposite direction #G Move to line # (0 = EOF) "[\w\d] Use register [\w\d] for next edit (yank, put, delete) << Delete indention >> Insert indention q[a-z] Start recording into register [a-z] q[A-Z] Append recording to register [a-z] q Stop recording @[a-z] Execute contents of register [a-z] K Lookup word under cursor using 'man' ga Show ASCII value of character under cursor g^g Show info on character under cursor ^ws Split window into two (both containing same file) :split Split window, and edit in new window :new || ^wn New window :q || ^wq Close window ^wo Make this window the only one to edit ^w[jklh] Move to other window ^ww Move to next window ^wt Move to top window ^wb Move to bottom window ^w= All windows equal height ^w+ Increase height of current window ^w- Decrease height of current window ^w_ Give window maximum height zf Make a fold over :fold Fold range zo Open fold under cursor zi Reverse 'foldenable' INSERT MODE ^n Autocomplete :) ^p Autocomplete, search backwards ^e Insert the character from below the cursor ^y Insert the character from above the cursor ^r Insert contents from register (0-9a-z%#:.-=") ^w Delete word before cursor ^t, ^d Indent line one shiftwidth (forward and backward) ^k(code) Insert special character (see :dig for codes) VISUAL MODE ~ Flip case o Move cursor to other beginnind/end of selected text and continue selecting <, >, ! Indent textblock (defined by shiftwidth), or filter text (e.g. using !sort) c Delete block and start typing (in Insert mode) d, y Delete, yank r Change block in all 's J Join lines gJ Join lines without inserting a space U, u Make upper/lowercase COMMANDS :sh Shell! :set nu Display line numbers :set nonu Don't display line numbers :set all View all settings :#,# Indicate a range :#,#d Remove range :#,#m# Move range #,# after line # :#,#co# Copy range #,# after line # . Current line 1 First line of file $ Last line of file % All lines in file .+20 20 lines after current line :.,+1s/x/y/igc From current line till and through next line, replace (s) x (regex) with y (text), while searching case insensitive (i), replacing more than one occurrence per line (g) and asking for confirmation. :g/x/d Search for all lines matching x and delete them (:g/^$/d deletes all blank lines) :g/^/mo0 Swap all lines (last line <=> first line, etc) With g/^/mo0 you move line by line, with m0 you move as a whole! :e! Reload file, undoing all changes :q! Exit vim :w Save file as :r Insert into current document :! Execute command in shell and view output :r ! Insert output from command into current document! :! Apply to (Perl is extremely handy here!) : :%!sort -g => Sort numerically :%!uniq => Filter all dupes :%!tr '[a-z]' '[A-Z]' => everything uppercase :%s/[a-z]/\u&/g => everything uppercase as well :r !perl -e 'for ($i = 1; $i <= 10; $i++) { print sqrt($i); print "\n"; }' => Add square roots of 1 through 10 :ab <1> <2> Abbreviation => automagically replace <1> with <2> while you type :unab Unabbreviate abbreviation :dig Show ASCII characters :D :reg Show contents of registers :edit Edit :enew New file"