i = insert mode at cursor
I = insert at the beginning of line
a = append after the cursor
A = append at the end of the line
o = open blank line below current line
O = open blank line above current line
Esc = exit insert mode
光標(biāo)移動(dòng)
h,j,k,l = ←, ↓, ↑, →
ctrl+f = 下一頁(yè)(forward)
ctrl+b = 上一頁(yè)(backward)
[N]G = 跳到第N行
`. = 跳到最后編輯的地方
w = 跳到下一個(gè)單詞的開頭
W = 跳到下一個(gè)單詞(空白分隔)的開頭
e = 跳到下一個(gè)單詞的末尾
E = 跳到下一個(gè)單詞(空白分隔)的末尾
b = 跳到前一個(gè)單詞的開頭
B = 跳到前一個(gè)單詞(空白分隔)的開頭
0 = 跳到本行行頭
$ = 跳到本行行尾
^ = 跳到本行第一個(gè)非空白字符
g_ = 跳到本行最后一個(gè)非空白字符
gg = 跳到第一行
G = 跳到最后一行
* = 向下查找當(dāng)前光標(biāo)所在位置的字符串
# = 向上查找當(dāng)前光標(biāo)所在位置的字符串
編輯
ctrl+r = redo
u = undo
~ = switch case
>> = indent line one column right
<< = indent line one column left
== = auto-indent current line
剪切與粘貼
dd = 刪除當(dāng)前行,并把刪除的行存到剪貼板里
x = 刪除當(dāng)前字符
X = 刪除前一個(gè)字符
dw = delete to end of word
D = delete to end of line
yy = 復(fù)制當(dāng)前行
[N]yy = 復(fù)制N行
yw = copy to end of word
y$ = copy to end of line
p = 在光標(biāo)位置之后粘貼
P = 在光標(biāo)位置之前粘貼
查找
/pattern = search for pattern
?pattern = search backwards for pattern
n = repeat search in same direction
N = repeat search in opposite direction