Getting Started Linux Users: 1) Make sure you have the advanced package(s) installed on your system. (Look for a file called gvim) 2) touch ~/.vimrc Window Users: Get the binary from http://www.vim.org First commands u -- Undo **multiple levels** CTRL-R -- Redo Help :help -- General help :help u -- Help on the normal mode u command :help CTRL-R -- Ctrl-R command (normal mode) :help 'sw' -- The sw option :help i_CTRL-D -- Insert mode Ctrl-D :help v_d -- Visual mode d :help! -- See for yourself :help 42 -- The ultimate answer :helpgrep holy\c -- A mythical search for help Windows and Tabs :split -- Split the window :split -- Split and open a new file :vsplit -- Vertical split :vsplit -- Split and open a new file :tabnew -- Open a new tab with the given file :q -- Close tab or window ZZ -- Close tab or window CTRL-Wj, CTRL-Wk, CTRL-Wh, CTRL-Wl -- Move to next window down, up, left, right Building Programs :make -- Run a make command :cc -- Display current error :cn -- Display next error :cp -- Previous error :copen -- Open a window containing the error log Diff mode gvimdiff -- Start gvim in "diff" mode do -- Get diff from the other window dp -- Put diff to the other window Internal Grep :vimgrep // is any regular expression can contain wildcards *, ?, [xyz] and ** for any set of directories. Indenting :set sw=4 -- Set the indent size (shift width) :set cindent -- Turn on C style indentation =% -- Indent a block enclosed in {} v -- move -- = -- Indent visually Tabs :set expandstabs -- No tabs in the text :retab -- Redo the tabs to a new tabstop Searching :set hlsearch -- Turn on search highlighting :nohl -- Turn it off until next search :set insearch -- Incremental searching / -- Search history q/ -- Search history window Spelling :set spell -- Highlight spelling errors z= -- Display a list of possible corrections :set mousemodel=popup -- Right click to bring up correction list Seeing the invisible :set list -- Make the hidden visible :set nolist -- Hide things again Autocommands :autocmd FileType *[ch] set cindent,expandtabs Virtual Editing :set ve=all -- Turn on virtual editing Keyboard Macros qx -- Start macro x q -- End macro @x -- Execute a macro Abbreviations and Mappings :abb #d #define :map =%