Brief
- Editing in the line
- i I a A
- Navigating
- h j k l
- w b e
- making changes in command mode
- x r
Mode
- insert
i
- command
:
- visual
v
- search
/
Insert
- before cursor
i
- insert from the begin
I
- after the cursor
a
- insert from the end
A
Navigate
- 左
h
- 下
j
- 上
k
- 右
l
- 向下五行
5j
- navigate between words
- word begin
w
- word begin in the opposite direction
b
- word end
e
- word begin
- scroll by pages
crl + u crl + d
- navigate with line number
: number + enter number + G
- navigate with blank lines
} {
- go to the end of the file
G
- go to the begin of the line
$
- go to the end of the line
0
Delete
- single char
x
- delete words
- delete single word
dw
- delete two words
d2w
- entire line
dd
Undo
u
Show line number
:set number
Visual mode
- choose a certain range in the same line
v
- copy
y
- copy the whole line
yy
- paste (paste the last thing being deleted or copied)
p
Visual line mode
- choose a certain range in different lines
shift + v
Before quit
- save
:w
- run the code
Making changes in command mode
- delete
x
- replace
r
Copy and paste
- Copy to browser
V, ”+, y V is to choose the whole line ”+ is the default register to the system
- Copy from browser
”+, p