目录
Two modes, insert and normal
normal:除插入新文本外的操作
insert:插入新文本
normal=>insert:i
insert=>normal:esc
Basic movement: h, j, k, and l
左移:h
下移:j
上移:k
右移:l
Word movement: w, e, b
至下一词首:w
至下一词尾:e
至上一词首:b
Number powered movement, e.g. 5w
重复输入某一操作:次数(+)操作
Insert text repeatedly, e.g. 3iYes
重复输入某文本:次数(+)i(+)文本(+)esc
Find a character, f and F
至某文本下一次出现处:f(+)文本
至某文本下某次出现处:次数(+)f(+)文本
Go to matching parentheses, %
对应括号之间跳:光标在括号处时%
Go to start/end of line, 0 and $
至行首:0
至行尾:$
Find word under cursor, * and #
至光标处文本上一次出现处:*
至光标处文本下一次出现处:#
Goto line, g and G
至文件首:gg
至文件尾:G
至某行行首:行数(+)G
Search, /text with n and N
搜索文本:/(+)文本(+)enter
至文本下一次出现处:n
至文本上一次出现处:N
Insert new line, o and O
在下面插入新行,进入insert模式:o
在上面插入新行,进入insert模式:O
Removing a character, x and X
删除光标处字符:x或X
Replacing letter under cursor, r
将光标处字符替换为新字符:r(+)新字符
Deleting, d
删除文本:d(+)移动操作
删除整行:dd
Repetition with .
重复上一操作
Visual mode, v
选择一段文本并删除:v(+)移动操作(+)d
Real Vim awaits
保存::(+)w
退出::(+)q
退出且不保存::(+)q(+)!
撤销:u
重做:ctrl(+)R
帮助::(+)help