-
Notifications
You must be signed in to change notification settings - Fork 3
VIM Cheat Sheet
Franklin Wise edited this page May 13, 2015
·
8 revisions
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)
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
- i - insert, start editing wherever the carrot is
- o - open a line up (also shift o)
- a - append
In COMMAND mode:
- u - undo
- ctl r - redo
- 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
yy - yank whole line dd - delete