Skip to content

Instantly share code, notes, and snippets.

@falmp
Last active August 29, 2015 13:56
Show Gist options
  • Save falmp/8933480 to your computer and use it in GitHub Desktop.
Save falmp/8933480 to your computer and use it in GitHub Desktop.
vim cheat sheet

vim cheat sheet

tabular

shortcut command
,a= align tabular data by =
,a=> align tabular data by =>
,a: align tabular data by :
,a, align tabular data by ,

diff

shortcut command
do copy changes from other buffer to the current buffer (obtain)
dp copy changes from current buffer to the other buffer (put)
]c jump to the next change
[c jump to the previous change

folding

shortcut command
zf<Motion> create fold (i.e. zfa( or zfa5j)
zd delete fold in cursor
zo open fold in cursor
zc close fold in cursor
za toggle fold in cursor
zD delete all folds in cursor recursively
zO open all folds in cursor recursively
zC close all folds in cursor recursively
zA toggle all folds in cursor recursively
zr open 1 fold level (reduce)
zm close 1 fold level (more)
zR open all folds
zM close all folds
zE delete all folds
zx reset folds and view current line
zX reset folds
<F9> toggle fold
<Space> toggle fold (normal mode); create fold (visual mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment