15-131: Great Practical Ideas For Computer Scientists Vim Cheat Sheet
15-131: Great Practical Ideas For Computer Scientists Vim Cheat Sheet
15-131: Great Practical Ideas For Computer Scientists Vim Cheat Sheet
Copy/paste commands operate on the specified range. If in visual mode, that range is the
Editing highlighted text. If in normal mode, that range is specified by a series of modifiers to the
commands:
i Insert before current character
cw Change one word
a Insert after current character
c4w Change four words
I Insert at the first non-whitespace character of the line
c4l Change four letters
o Insert a line below the current line, then enter insert mode
cc Change current line
O Insert a line above the current line, then enter insert mode
4x Change four characters after the cursor
r Overwrite one character and return to command mode
4p Paste five times after the cursor.
U Undo
Ctrl+R Redo Modifiers work similarly for cut, delete, yank and paste.