Last active
December 18, 2015 00:09
-
-
Save kxhitiz/5694435 to your computer and use it in GitHub Desktop.
My Vim Commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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