Skip to content
Franklin Wise edited this page May 13, 2015 · 8 revisions

VIM Cheat Sheet

THREE MODES!!!

Command Mode - hit escape one or more times and you'll get here

Edit Mode - hit one of the edit keys in command mode and you get here. once you are in edit mode, it's just like notepad until you hit the escape key.

  • i - insert
  • o - open
  • a - append

*Visual Mode - hit v and then move around and it'll select text like you would with click and drag on the mouse. Whatever is selected can be copied, replaced, cut, deleted by typing the corresponding 'command' key (i.e. x for cut)

Moving Around (in command mode)

one letter at a time:

  • j - down

  • k - up

  • h - left

  • k - right

one word at a time:

  • w - word forward
  • e - end of word forward
  • b - back a word

line:

  • $ - end of line (just like regex)
  • ^ - first non-white character (think regex)
  • 0 - beginning of line

page down:

  • ctl f - forward a page
  • ctl b - backward a page

editing (in command mode)

  • i - insert, start editing wherever the carrot is
  • o - open a line up (also shift o)
  • a - append

UNDO and REDO

In COMMAND mode:

  • u - undo
  • ctl r - redo

cut and paste (two ways: command mode and visual mode)

  • x - cut
  • p - paste
  • d - delete
  • y - copy aka yank

so you want to copy a word, combine the cut, copy, delete command with a navigation command:

yw - yank word dw - delete word

common shortcuts

yy - yank whole line dd - delete

Clone this wiki locally