Typo209 - Comprehensive Vim Cheat Sheet
Typo209 - Comprehensive Vim Cheat Sheet
Working With Files Moving Around in the File (cont) Deleting Text
:e Open a new file. You can use the L To the the last line of the screen. x Delete characters under the cursor.
filename Tab key for automatic file name :n Jump to line number n. For example, to X Delete characters before the cursor.
completion, just like at the shell
jump to line 42, you'd type :42
dd or :d Delete the current line.
command prompt.
h or Left one character. yy Yank the current line. You don't need to /pattern Search the file for pattern.
Left or highlight it first. n Scan for next search match in the
l or Right one character. :y same direction.
or
Right N Scan for next search match but
Y
e To the end of a word. opposite direction.
dd Delete the current line. Again, you don't
E To the end of a whitespace-delimited
or need to highlight it first.
word. Undo and Redo
:d
b To the beginning of a word. u Undo the last action.
p Put the text you yanked or deleted. In
B To the beginning of a whitespace- Windows terms, "paste the contents of U Undo all the latest changes that were
delimited word. the clipboard". Put characters after the made to the current line.
0 To the beginning of a line. cursor. Put lines below the current line. Ctrl+r Redo.
^ To the first non-whitespace character P Put characters before the cursor. Put
$ To the end of a line. Note: the Vim commands marked with (V) work
in visual mode, when you've selected some
H To the first line of the screen.
text. The other commands work in the
M To the middle line of the screen.
command mode, when you haven't selected
any text.
Visual Mode