Skip to content

Instantly share code, notes, and snippets.

@omerk
Created March 4, 2014 18:53
Show Gist options
  • Save omerk/9353095 to your computer and use it in GitHub Desktop.
Save omerk/9353095 to your computer and use it in GitHub Desktop.
vim cheatsheet

Open/Edit/Close

cd <folder> change to folder

r <file> insert file below cursor

r !<cmd> insert command output below cursor

o begin new line, insert

gf goto file under the cursor

cq q!

Movement

h left

j down

k up

l right


w next word

b beginning of word

e end of word


( previous sentence

) next sentence

{ beginnning of paragraph

} end of paragraph

Tabs

vsplit vertical split ( | )

ctrl + w + > ctrl + w + < vertical resize

ctrl + w + left ctrl + w + right vertical navigation


split horizontal split ( - )

ctrl + w + + ctrl + w + - horizontal resize

ctrl + w + up ctrl + w + down horizontal navigation

Formatting

(after selecting text)

> indent

< un-indent

gq wrap (set textwidth=80)

* search for the word under the cursor

~ flip case letter under the cursor

ctrl + a increase number under cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment