Typing a number before a motion or operator repeats it nth times
w
- Move to the beginning of each word.
e
- Move to the end of each word.
0
- Move to the beginning of the line (zero).
$
- Move to the end of the line.
gg
- Move to top of file.
shift + g
- Move to bottom of file.
line + shift + g
- Moves you back to the line before you gg
or shift g
dw
- Deletes FROM cursor to beginning of next word (excluding it's first chr)
de
- Deletes FROM cursor to the end of the current word (including last chr)
d$
- Deletes FROM curso to the end of the current line.
dd
- Deletes the entire line.
x
- Deletes a sinlge element on the cursor
u
- Undo the last command.
U
- Returns the line to it's original state.
CTRL-R
- Redo the last command.
p
- puts previously deleted text after the cursor or previously deleted line below the cursor.
i
- Insert text before the cursor
a
- Insert text after the cursor
I
- Insert text at the beginning of the line
A
- Insert text at the end of the line
r[x]
- Replaces element on cursor with x.
ce
or cw
- Deletes FROM the cursor to the end of the word and goes into insert mode, to make changes.
Remember c[num][motion]
:s/old/new
- Changes the first occurrence of the old word on that line.
:s/old/new/g
- Changes the old word globally within the line.
:%s/old/new/g
- Changes every the old word globally within the file.
:%s/old/new/g
- Changes every the old word globally within the file w/ a prompt to substitute or not.
/ + [search_term]
- Search within the file.
n
- move to the next found search term
N
- move to the previous search term
CTRL + o
- go back where you came from
CTRL + i
- go forward
%
- Finds the matching ( { [ ] } )
v
- Puts you in Visual mode, use motion commands to select text.
CAPS (CTRL) c
- Close a window pane
CAPS (CTRL) q
- Quit a window pane
CAPS (CTRL) s
- Open a window pane
[num] CAPS (CTRL) K|J|H|L
- Move to nth window pane up|down|left|right ([num]
is optional)
t
- Open file in new tab (new cursor is on a filename)
gt
- Move between tabs (go
to tab
)
Vim Documentation: Window Panes (opening, closing, moving, resizing, etc)