Skip to content

Instantly share code, notes, and snippets.

@kxhitiz
Last active December 18, 2015 00:09
Show Gist options
  • Save kxhitiz/5694435 to your computer and use it in GitHub Desktop.
Save kxhitiz/5694435 to your computer and use it in GitHub Desktop.
My Vim Commands
Surround:
yss" - surround whole line with "
ysiw" - surround a word with "
cs'" - replace surround - with "
ds" - delete surround "
Tabs:
:tabnew
:tabp
:tabn
Edit
ctrl + w ## erase word
ctrl + n ## erase line
:set tabstop=2
:set shiftwidth=2
ctrl-t, ctrl-d - indent current line forward, backwards
(insert mode)
visual > or < - indent block by sw (repeat with . )
You can also record a whole series of edits to a register, and then apply them over and over.
qk - records edits into register k
(q again to stop recording)
@k - execute recorded edits (macro)
@@ - repeat last one
5@@ - repeat 5 times
http://www.cs.swarthmore.edu/help/vim/indenting.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment