-------------------------------- BASICS -------------------------------- i / insert u / Undo / Redo :q / quit :q! / force :wq / save and quit Escape insert mode -------------------------------- NAVIGATE -------------------------------- hjkl or arrows / moving around w / next word b / previous word } / next paragraph { / previous :3 / move to line 3 gg / beginning of file G / end of file 0 / beginning of line $ / end of line % / corresponding parenthesis -------------------------------- EDIT -------------------------------- i / Insert before a / Insert after I / Insert beginning line A / Insert end line o / Insert bellow O / Insert above r / replace cw / change word c} / Change paragraph x / cut character dd / cut line dw / cut word y / copy (yank) character yy / copy line 3y / copy 3 lines yw / copy word p / paste / Increase a number / Decrease a number . / Repeat last change -------------------------------- SEARCH -------------------------------- / / Search a text / / Search previous text # / Search the selected word n / next find N / previous find :noh / hide highlight -------------------------------- VISUAL -------------------------------- v select characters select line select columns y / yank selection :s/// sed on selection -------------------------------- REGISTER ('+' needs vim-gnome or macvim) -------------------------------- "+y / yank to register + "+p / paste from register + :registers -------------------------------- FOLDING -------------------------------- Select a few lines: zf / fold za / unfold -------------------------------- FILES -------------------------------- vim one.txt two.txt :edit pom.xml / open a file (Autocomplete) :new / create a file :ls / list open files (:buffers) :n / To next file :p / To previous file :b4 / To file 4 :b / autocomplete files -------------------------------- WINDOWS -------------------------------- :help :split :vsplit hjkl / arrows / move cursor + / - / resize horizontally split windows < / > / resize vertically split windows = / resize equally all windows / maximize current window (See plugin section) HJKL / r / move windows c / close a window -------------------------------- TABS -------------------------------- :tabnew :tabclose :tabn / next :tabp / previous :tabm / move a tab -------------------------------- MARKS -------------------------------- ma / add mark a dma / remove mark a 'a / Jump to mark a :marks / list all marks -------------------------------- MACRO RECORD -------------------------------- qa / Start recording in register a q / stop recording @a / Play macro from register a 3@a / Play 3 times -------------------------------- EXTRA -------------------------------- :set list :set nolist :set number :set nonumber = / Formatting :! / Execute a command without exiting vim :w !sudo tee % > /dev/null / Write as root -------------------------------- CONFIGURATIO / PLUGINSN -------------------------------- ~/.vimrc cmap w!! / make new shortcuts Airline (Status bar custom) Git Gutter (Git changes) Solarized (Color scheme) Surround: - cs"' / replace " by ' - cst
/ replace current surrounding by

- yss) / surround the line by ( and ) - ysiw] / surround the word by [ and ] - dst / remove surrounding / NerdTree / Search files Supertab: - / autocompletion Zoomwin: - / maximize current window Fugitive (Git integration): - :Gblame / Display blame per line - :Gstatus - / p / Add or Reset file and patch - :Gcommit / Commit