-
Notifications
You must be signed in to change notification settings - Fork 11
Vim Cheatsheet
Santiago Agüero edited this page Jan 30, 2015
·
2 revisions
-
<C-o>
move to a previous cursor -
<C-i>
move to a forward cursor -
<C-]>
jump to first tag ocurrence. Cycle with tpope/unimpared ]t [t -
<C-t>
jump to first item in the tagstack -
gv
rehighlights the last selection -
gb
rehighlights the last pasted text (custom mapping) -
g&
repeat last substitute preserving flags -
gw
reformat line according textwidth -
gi
go to last insertion and switch to insert mode -
<C-n|p>
Word wise completion -
<C-x-l>
Line wise completion -
<C-x-f>
File wise completion -
<C-x-k>
Dictionary completion -
<C-x-o>
Omni completion -
<C-x-u>
User custom completion -
:vs#
split and open the alternate file -
cgn
Change visual selection (repeteable) -
<C-x-e>
In bash, open $EDITOR with current command line
-
[s
move to previous misspelled word -
]s
move to next misspelled word -
z=
show alternatives to correct misspelled
-
:%s/\v(very magic)/\1/gc
very magic mode -
<c-r><c-w>
insert word under cursor -
<c-r>/
insert last search pattern -
<c-r>0
insert last yank
-
ma
set mark 'a' to current position - ``a` go to mark 'a'
- ``.` go to last change mark
- ``^` mark to go to last insertion
-
g;|g,
go forward/backward through the changelist -
:marks
show all available marks
-
:e!
reload current file discarding changes -
:r [file]
insert content of file -
:r !date
insert the results from command
-
do
get changes from other window into current one -
dp
put changes from current window into other one -
]c
jump to the next change -
[c
jump to the previous change -
:windo diffthis
activate vimdiff in splitted window -
:windo diffoff
deactivate vimdiff mode -
:diffupdate
update diff color (useful after undo operation)