vim cheat sheet
this is not an exhaustive list and most probalby will be extended in the future
paste
"+p
- paste from global buffer (clipboard)
edit (insert mode)
<ctrl-n>
- auto-completion next<ctrl-p>
- auto-completion previous<ctrl-t>
- indent line<ctrl-d>
- outdent line<ctrl-r>
- paste from register (“ - default register)<ctrl-j>
- insert a new line<ctrl-h>
- backspace<ctrl-w>
- delete a word backwards from cursor<ctrl-o>
- run a single normal command and return to insert mode
edit (normal mode)
.
- repeat last command (insert is treated as a single command)R
- type over textvtc
- visual to character, excluding the charcter (v can be replaced for any operator, c - for any character, see below)vfc
- visual to character, including the character (v can be replaced for any operator, c - for any character, see below)J
- join linesd/<pattern>/e<enter>
- delete from cursor to the end of matchy?<pattern>
- copy from cursor to previous matchg/<pattern>/d
- delete lines that match globally
navigate
''
- back to previous position'.
- back to previous edit{
- back one paragraph}
- forward by one paragraph*
- next occurance of word under cursor%
- bounce between brackets, beginning and end of a single methodo
- bounce between beginning and end of a visual block
search
q/
- advanced search
panes
<ctrl-w>v
- split vertically<ctrl-w>s
- split horizontally<ctrl-w>q
- close<ctrl-w>o
- close all but current
vit (visual inside tag)
- v - operator, i - extent, t - object
- operator is one of:
- change
- delete
- yank
- visual
- extent is one of:
- around (a)
- inside (i)
- object is one of:
- word (w)
- Word (W)
- sentence (s)
- pagragraph (p)
- tag (t)
- ” ‘ [ { (
favourite plugins
- syntastic
- ctrlp.vim
- vim-colors-solarized
- vim-json
custom key mappings
If you liked this post, you can
share it with your followers
or follow me on Twitter!