Skip to content

Instantly share code, notes, and snippets.

@dimanyc dimanyc/
Last active Jul 14, 2016

What would you like to do?
basic VIM commands


v(*)"+y - will copy lines selected in Visual mode.


zfat or zfit - folds HTML by indentation?

Find / Replace:

:s%/foo/bar/g - Change each 'foo' to 'bar', (% means in every line)

Windows Resizing:

ctrl + w then [n](optional) then direction (<< or >>)


:b# - back to previusly buffered command


:Vexplore - vertical explorer window


gg = G - normalizes indentation

Vim Surround

cst=[tag] - change surround tag or symbol


h - left

j - down

k - up

l - right


:q - discard and quit :x - save and quite. add ! (bang) to force


x - delete single charater d$ - delete everything follwoing the current cursor position ( to the end of the line ) dw - delete word , or everyting until the start of the next word, EXCLUDING its first character 'de' - delete everything to the end of the current word, INCLUDING the last character.

Motions with count:

(n)w- move n words forward (n)e- move to the end of the nth word foward 0 - move to the begining of the current line

Deletion with motions:

d(n)w - deletes the n numbe of words (n)dd - deletes n number of lines


u - undoes the last commands U - undoes changes to a line Ctrl (command) + r - undoes the undos #<= wtf??


A - start inerting at the end of line (without replacing the last char)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.