-
- / # Move to next / previous word under cursor
-
H / B / L # move to top/middle/bottom line of the screen. Follow this possibly by:
-
z. put the line with the cursor at the center
-
zt put the line with the cursor at the top
-
zb put the line with the cursor at the bottom of the screen
-
CTRL-O CTRL-I undo/redo last jump
- m[a-z] define a mark in the current file
- m[A-Z] define a global mark
- '[a-z, A-Z] jump to the line (in the appropriate file in case of [A-Z]) containing the mark
- mV in .vimrc : quick shortcut to upen .vimrc by 'V
- ciw # Change inside word. Delete the current word and enter insert mode.
- ci" # Change inside quotes. Delete what is inside quotes and enter insert mode.
- ca" # Change outside quotes. Delete quotes and what's inside them, and enter insert mode.
- cip # Change a paragraph.
- vip # Select a paragraph.
- Press q followed by a lowercase letter (the register).
- Perform some editing.
- Stop recording by pressing q.
- Play the macro by pressing q and the letter you chose.
- To repeat it, type :N @ macroletter, in which N is the number of times.
Line wrapping and textwidth. (original)
- gq # Rewrap the text.
- :set tw=72 # Rewrapping will rewrap to 72 columns.
- :set fo=cqt # Enable automatic wrapping with the
t
flag. Must have a nonzero value oftw
set. - :set tw=0 fo=cqt wm=5: Automatic wrapping at a 5 col right margin. That's a good one
- :ls # List currently opened files.
- :b filename # Show
filename
(which should be already open) in the current buffer.