Vim 移动命令
Vim移动命令小结:
word和WORD 字和长字的介绍
word代表一个单词,有字母和数字组成 或者使 一列非字母和数字的字符串, 不包含空格,tab,和换行。
A word consists of a sequence of letters, digits and underscores, or a sequence of other non-blank characters, separated with white space (spaces, tabs,
Example: (each word is surrounded by a rectangle)
|while| |(|next_line1| |!==| |“|The END|!”)| |do| |{|
|next_line1| |=| |readNextLine|();|
|}|
WORD 长字代表一系列的字符串。 由blank tab 换行区分 A WORD consists of a sequence of non-blank characters, separated with white space. An empty line is also considered to be a WORD. Use ‘W’, ‘E’, and ‘B’ to navigate WORDs. Special case: “cW” is treated like “cE” if the cursor is on a non-blank. This is because “cW” is interpreted as change-WORD, and a WORD does not include the following white space. Example: (each WORD is surrounded by a rectangle)
|while| |(next_line1| |!==| |“The END!”)| |do| |{|
|next_line1| |=| |readNextLine();|
|}|
vim移动命令Normal模式下
文件滚动
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
大段移动
1 2 3 |
|
标记移动
1
|
|
相对于光标滚屏
1
|
|
不同窗口间的移动
1 2 3 |
|
文件间切换命令
1 2 3 4 5 |
|
折叠行并移动
···
zo – 打开光标下的折叠
zO – 循环打开光标下的折叠,也就是说,如果存在多级折叠,每一级都会被打开
zc – 关闭光标下的折叠
zC – 循环关闭光标下的折叠
··· 更多的命令,请参阅手册(:help folding)。
vim提供了一些命令在折叠间快速移动: ···
[z – 到当前打开折叠的开始
]z – 到当前打开折叠的结束
zj – 向下移动到下一个折叠的开始处
zk – 向上移动到上一个折叠的结束处
···
跳转
1 2 3 |
|