Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Normal Mode

h : left
j : down
k : up
l : right
esc : enter normal mode
i : insert text at cursor
o : insert text on text line
V : select text
:$ : end of file
v : highlight while moving cursor
c : change highlighted text
V : highlight multiple lines
> : indent lines
< : decrease indent
dd : cut line
d : cut
u : undo
y : copy
yy : copy a line
p : paste

gg : top of file
[line_num]gg : specific line
G : end of file
% : jump to matching ({[]})

:w : save
:wq : save and exit
:q : quit
:q! : force quit
:[line_number] : jump to line line number

:/[Search_keyword] : search for string forward


n : go to next
:?[Search_keyword : search for string back
:/<enter> or :?<enter> : last search

* : search for word under cursor


# : same backwards
Motions
0 : first character in a line
^ : first non-blank character in a line
$ : end of line
g_ : non-blank character at end of line

} : down entire paragraph


{ : up entire paragraph
CTRL D : move down half page
CTRL U : move up half page

word

w : jump to beginning of next word


b : jump to beginning of word backwards
e : jump to end of word
ge : jump to end of word backwards

WORD

W
B
W
gE
Move with counts
[number][motion]

2w : move cursor 2 words forward


5j : move cursor 5 lines down
3; : next third occurrence of a character
2/baby : second occurrence of baby

Move to character
f[CHARACTER] : next occurrence of a character
F[CHARACTER] : previous occurrence
t[CHARACTER] : cursor just before character
T[CHARACTER] : same as t but backwards

Edit multiple lines


1. Move cursor to first location
2. Ctrl V
3. move cursor up and down
4. Press I
5. type in text
6. esc

You might also like