Skip to content

Instantly share code, notes, and snippets.

@gipert
Last active February 28, 2019 15:09
Show Gist options
  • Save gipert/2313c56484699d385b086f5ec241725a to your computer and use it in GitHub Desktop.
Save gipert/2313c56484699d385b086f5ec241725a to your computer and use it in GitHub Desktop.
Vim cheat sheet

Vim cheat sheet

See https://github.com/gipert/.dotfiles

Miscellanea

:echo [&]<variable>    " print [option]variable value
:so ~/.vimrc           " reload vimrc

Move

$   " jump to EOL
A   " jump to EOL in insert mode
0   " jump to BOL
I   " jump to BOL in insert mode
^   " jump to first non-blank character of line

Help

:vert h           vertical split
<Enter>           follow link
<Backspace>       go back

embed settings in file:

[comment chars]<spaces>vim:<spaces>settings
# vim: filetype=py tw=72

panels

:[v]split <file>
\ww (change panel) \ww    " swap panels with wesQ3/vim-windowswap
<C>w <cols> +|-           " resize panel

visual mode

D    " cut till eol
viw  " select word
yiw  " yank word

folding

za    " toggle open/close current fold
zM    " fold everything
zR    " unfold everything
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment