Command mode ---> Insert mode: i,a,o,I,A,O
i: Insert characters before the cursor(光标)
a: Insert characters after the cursor
o: Insert characters from the next line
I: Insert characters from the beginning of a line
A: Insert characters from the last of a line
O: Insert characters from the previous line
Command mode ---> Last line mode: :
Insert mode/Last line mode --->Command mode: Esc
Orders
Command mode
yy: copy the line
p: paste
dd: delete/cut the line
D: delete/cut the cursor and subsequent(后来的) contents
d0: delete/cut the before contents of the cursor
dw: delete/cut the word
x: delete the cursor ->(删除方向)
X: delete the cursor <-(删除方向)
u: undo order
.: redo before order
v/V: select multiple lines of code(需配合方向键)
>>: move to the right(右移代码)
<<: move to the left(左移代码)
}: move to the before paragraph
{: move to the next paragraph
nyy: copy n lines, n is a number
ndd: delete/cut n lines, n is a number
Ctrl+f: pageup
Ctrl+b: pageon
Ctrl+r: undo undo (反撤销)
nG: go to line n, n is a number
G: go to the last line
gg: go to the first line
w: go to the beginning of the next character
b: go to the beginning of the previous character
------------------------------------------------------------------
r: replace a character
R: replace multiple characters
h: lift <-
j: up
k: on
l: right ->
M: the middle of the current screen
L: the bottom of the current screen
H: the top of the current screen
/: search
n: search up(查找下一个搜索值)
N: search on(查找上一个搜索值)
Shift+ZZ: save and quit
Last line mode
w: save
q: quit
wq: save and quit
%s/abc/123/g: replace
usage: %s/原内容/新内容/g
n1,n2s/abc/123/g: replace the contents between line n1 and n2 usage: 起始行,结束行s/原内容/新内容/g
!: enforce(强制执行)
usage: q!(强制退出)