您的位置:首页 > 其它

VI 快速参考指南

2006-01-19 23:47 330 查看
快速参考指南

代码:
*quickref* *Contents*
tag subject tag subject ~
|Q_ct| 帮助文件清单 |Q_re| 重复命令
|Q_lr| 移动: 左右 |Q_km| 键盘映射
|Q_ud| 移动: 上下 |Q_ab| 缩写
|Q_tm| 移动: 文本目标 |Q_op| 选项
|Q_pa| 移动: 查找方式 |Q_ur| 取消/重复 命令
|Q_ma| 移动: 标记 |Q_et| 外部命令
|Q_vm| 移动: 其他 |Q_qf| Quickfix 命令
|Q_ta| 移动: 使用标签 |Q_vc| 其他命令
|Q_sc| 卷屏 |Q_ce| Ex: 命令行编辑
|Q_in| 插入: 插入文本 |Q_ra| Ex: 范围
|Q_ai| 插入: 普通键 |Q_ex| Ex: 特殊字符
|Q_ss| 插入: 特殊键 |Q_ed| 文件编辑
|Q_di| 插入: 二合字母 |Q_fl| 使用参数列表
|Q_si| 插入: 特殊插入 |Q_wq| 写入与退出
|Q_de| 改动: 删除文本 |Q_st| 启动 VIM
|Q_cm| 改动: 拷贝与移动 |Q_ac| 自动命令
|Q_ch| 改动: 修改文本 |Q_wi| 多窗口命令
|Q_co| 改动: 复杂 |Q_bu| 缓冲列表命令
|Q_vi| 可视模式 |Q_sy| 语法加亮
|Q_to| 文本对象 |Q_gu| GUI 命令
|Q_fo| 折叠

------------------------------------------------------------------------------
N 用来(可选)至于命令之前表示该命令执行的次数。
------------------------------------------------------------------------------
*Q_lr* 左右移动

|h| N h 左 (亦: CTRL-H, <BS>, 或 <Left> 键)
|l| N l 右 (亦: <Space> 或 <Right> 键)
|0| 0 移动至本行第一个字符 (亦: <Home> 键)
|^| ^ 移动至本行第一个非空白字符
|$| N $ 移动至本行(N-1 后续行)最后一个字符
(亦: <End> 键)
|g0| N g0 移动至屏幕行的第一个字符 (当折行时和 "0" 不同)
|g^| N g^ 移动至屏幕行的第一个非空白字符 (当折行时和 "^" 不同)
|g$| N g$ 移动至屏幕行的最后一个字符 (当折行时和 "$" 不同)
|gm| N gm 移动至屏幕行的中点
|bar| N | 移动至第N列 (缺省: 1)
|f| N f{char} 移动至右边第 N 次出现{char}的地方
|F| N F{char} 移动至左边第 N 次出现{char}的地方
|t| N t{char} 移动至右边第 N 次出现{char}之前
|T| N T{char} 移动至左边第 N 次出现{char}之前
|;| N ; 重复上次 "f", "F", "t", 或 "T" 命令 N 次
|,| N , 以相反方向重复上次 "f", "F", "t", 或 "T" 命令 N 次
------------------------------------------------------------------------------
*Q_ud* 上下移动

|k| N k 上移 N 行 (亦: CTRL-P 和 <Up>)
|j| N j 下移 N 行 (亦: CTRL-J, CTRL-N, <NL>, 和 <Down>)
|-| N - 上移 N 行, 并至第一个非空白字符
|+| N + 下移 N 行, 并至第一个非空白字符 (亦: CTRL-M 和 <CR>)
|_| N _ 下移 N - 1 行, 并至第一个非空白字符 (亦:
CTRL-M 和 <CR>)
|G| N G 至第 N 行(缺省: 末行), 并至第一个非空白字符
|gg| N gg 至第 N 行(缺省: 首行), 并至第一个非空白字符
|N%| N % 至以行术计算文件的 % N 处. 必须给出 N,
否则是 |%| 命令.
|gk| N gk 上移 N 行 (与 "k" 不同于折行的处理)
|gj| N gj 下移 N 行 (与 "j" 不同于折行的处理)
------------------------------------------------------------------------------
*Q_tm* 文本对象移动

|w| N w 向前至第 N 个单词
|W| N W 向前 N 个空白隔开的单词 |WORD|
|e| N e 向前至第 N 个单词词尾
|E| N E 向前至第 N 个以空白隔开的单词 |WORD| 的词尾
|b| N b 向后 N 个单词
|B| N B 向后至第 N 个以空白隔开的单词 |WORD| 的词尾
|ge| N ge 向后至第 N 个单词词尾
|gE| N gE 向后至第 N 个以空白隔开的单词 |WORD| 的词尾

|)| N ) 向前 N 个句子
|(| N ( 向后 N 个句子
|}| N } 向前 N 段
|{| N { 向后 N 段
|]]| N ]] 向前 N 节, 置于节的开始
|[[| N [[ 向后 N 节, 置于节的开始
|][| N ][ 向前 N 节, 置于节的末尾
|[]| N [] 向后 N 节, 置于节的末尾
|[(| N [( 向后至第 N 个未结束的 '('
|[{| N [{ 向后至第 N 个未结束的 '{'
|[m| N [m 向后至第 N 个方法的开始 (用于 Java)
|[M| N [M 向后至第 N 个方法的结束 (用于 Java)
|])| N ]) 向前至第 N 个未结束的 ')'
|]}| N ]} 向前至第 N 个未结束的 '}'
|]m| N ]m 向前至第 N 个方法的开始 (用于 Java)
|]M| N ]M 向前至第 N 个方法的结束 (用于 Java)
|[#| N [# 向后至第 N 个未结束的 "#if" 或 "#else"
|]#| N ]# 向前至第 N 个未结束的 "#else" or "#endif"
|[star| N [* 向后至第 N 各注释的开始 "/*"
|]star| N ]* 向前至第 N 各注释的结束 "*/"
------------------------------------------------------------------------------
*Q_pa* 按模式查找

|/| N /{pattern}[/[offset]]<CR>
向前查找第 N 次出现 {pattern}的地方
|?| N ?{pattern}[?[offset]]<CR>
向后查找第 N 次出现 {pattern}的地方
|/<CR>| N /<CR> 向前重复上次查找
|?<CR>| N ?<CR> 向后重复上次查找
|n| N n 重复上次查找
|N| N N 以反方向重复上次查找
|star| N * 向前查找光标下的标识符
|#| N # 向后查找光标下的标识符
|gstar| N g* 如 "*", 但也查找部分匹配
|g#| N g# 如 "*", 但也查找部分匹配
|gd| gd 移动至光标下表示符的局布声明
|gD| gD 移动至光标下表示符的全局声明

|pattern| 查找模式中的特殊字符

meaning magic nomagic ~
匹配任意单个字符 . /.
匹配行首 ^ ^
匹配 <EOL> $ $
匹配单词开始 /< /<
匹配单词结束 /> />
匹配标定范围中的单个字符 [a-z] /[a-z]
匹配不在标定范围中的单个字符 [^a-z] /[^a-z]
匹配一个标识符字符 /i /i
同上但不包括数字 /I /I
匹配一个关键字字符 /k /k
同上但不包括数字 /K /K
匹配一个文件名字符 /f /f
同上但不包括数字 /F /F
匹配一个可打印的字符 /p /p
同上但不包括数字 /P /P
匹配一个空白字符 /s /s
匹配一个非空白字符 /S /S

匹配 <Esc> /e /e
匹配 <Tab> /t /t
匹配 <CR> /r /r
匹配 <BS> /b /b

匹配 0 或多个前面的匹配原子 * /*
匹配 0 或多个前面的匹配原子 /+ /+
匹配 0 或多个前面的匹配原子 /= /=
匹配 2 至 5 个前面的匹配原子 /{2,5} /{2,5}
隔开两种可能的匹配 /| /|
将一个模式组成一个匹配原子 /(/) /(/)

|search-offset| 查找命令后可用的偏移量

[num] [num] 行向下, 位于第一栏
+[num] [num] 行向下, 位于第一栏
-[num] [num] 行向上, 位于第一栏
e[+num] 匹配结尾右方 [num] 个字符处
e[-num] 匹配结尾左方 [num] 个字符处
s[+num] 匹配启始右方 [num] 个字符处
s[-num] 匹配启始左方 [num] 个字符处
b[+num] 匹配启始右方 [num] 个字符处
b[-num] 匹配启始左方 [num] 个字符处
;{search-command} 接着执行 {search-command} 查找
------------------------------------------------------------------------------
*Q_ma* 标记与移动

|m| m{a-zA-Z} 用标记 {a-zA-Z} 记录当前位置
|`a| `{a-z} 移动至当前文件中的标记 {a-z}
|`A| `{A-Z} 移动至任何文件中的标记 {A-Z}
|`0| `{0-9} 移动至 Vim 上次退出的位置
|``| `` 移动至上次跳转至前的位置
|`quote| `" 移动至上次编辑此文件的位置
|`[| `[ 移动至上次被操作或放置的文本的开始
|`]| `] 移动至上次被操作或放置的文本的结尾
|`<| `< 移动至 (前次) 可视区域的开始
|`>| `> 移动至 (前次) 可视区域的结尾
|`.| `. 移动至当前文件最后被改动的位置
|'| '{a-zA-Z0-9[]'"<>.}
同 `, 但同时移动至该行的第一个非空白字符
|:marks| :marks 列出活动的标记
|CTRL-O| N CTRL-O 跳转至跳转列表中第 N 个较早的位置
|CTRL-I| N CTRL-I 跳转至跳转列表中第 N 个较晚的位置
|:ju| :ju[mps] 列出跳转列表
------------------------------------------------------------------------------
*Q_vm* 其他移动

|%| % 找到本行中下一个括号,方括号,注释,或 "#if"/
"#else"/"#endif" 并移动至与其对称的位置
|H| N H 移动至窗口的第 N 行的第一个非空白字符处
|M| M 移动至窗口的中间行的第一个非空白字符处
|L| N L 移动至窗口的第 N 行(从下方算)的第一个非空白字符处

|go| N go 移动至缓冲的第 N 个字节
|:go| :[range]go[to] [off] 移动至缓冲的第 [off] 个字节
------------------------------------------------------------------------------
*Q_ta* 使用标签

|:ta| :ta[g][!] {tag} 跳转至标签 {tag}
|:ta| :[count]ta[g][!] Jump to [count]'th newer tag in tag list
|CTRL-]| CTRL-] 跳转至光标下的标签,除非文件被改动
|:ts| :ts[elect][!] [tag] 列出匹配的标签并选择一个跳转
|:tjump| :tj[ump][!] [tag] 跳转至标签 [tag] ,当有多个匹配时从列表
中选择跳转

|:tags| :tags 列表标签
|CTRL-T| N CTRL-T 跳转至标签列表中第 n 个较早的标签
|:po| :[count]po[p][!] 跳转至标签列表中第 [count] 个较早的标签
|:tnext| :[count]tn[ext][!] 跳转至接下来的第 [count] 个匹配的标签
|:tp| :[count]tp[revious][!] 跳转至前面第 [count] 个匹配的标签
|:tr| :[count]tr[ewind][!] 跳转至第 [count] 各匹配的标签
|:tl| :tl[ast][!] 跳转至上次匹配的标签

|:ptag| :pt[ag] {tag} 打开一个显示 {tag} 标签的预览窗口
|CTRL-W_}| CTRL-W } 如 CTRL-] 但在预览窗口显示标签
|:pts| :pts[elect] 如 ":tselect" 但在预览窗口显示标签
|:ptjump| :ptj[ump] 如 ":tjump" 但在预览窗口显示标签
|:pclose| :pc[lose] 关闭标签预览窗口
|CTRL-W_z| CTRL-W z 关闭标签预览窗口
------------------------------------------------------------------------------
*Q_sc* 滚屏

|CTRL-E| N CTRL-E 窗口下卷 N 行 (缺省: 1)
|CTRL-D| N CTRL-D 窗口下卷 N 行 (缺省: 1/2 窗口)
|CTRL-F| N CTRL-F 窗口前卷 N 页 (向下)
|CTRL-Y| N CTRL-Y 窗口上卷 N 行 (缺省: 1)
|CTRL-U| N CTRL-U 窗口上卷 N 行 (缺省: 1/2 窗口)
|CTRL-B| N CTRL-B 窗口后卷 N 页 (向下) (向上)
|z<CR>| z<CR> 或 zt 重画,当前行置窗口顶端
|z.| z. 或 zz 重画,当前行置窗口正中
|z-| z- 或 zb 重画,当前行置窗口底端

一下仅当 'wrap' 选项关闭时生效:
|zh| N zh 屏幕右卷 N 个字符
|zl| N zl 屏幕左卷 N 个字符
|zH| N zH 屏幕右卷半个屏宽
|zL| N zL 屏幕左卷半个屏宽
------------------------------------------------------------------------------
*Q_in* 插入文本

|a| N a 在光标后添加文本 (N 次)
|A| N A 在行末添加文本 (N 次)
|i| N i 在光标签插入文本 (N 次) (亦: <Insert>)
|I| N I 在当前行的第一个非空白字符前插入文本 (N 次)
|gI| N gI 在第一栏中插入文本 (N 次)
|o| N o 在当前行下方开始新行,添加文本 (N 次)
|O| N O 在当前行上方开始新行,添加文本 (N 次)
|:startinsert| :star[tinsert][!] 开始插入模式,当使用 [!] 时添加文本

在可视块模式下:
|v_b_I| I 在所有选中的行首插入同样的文本
|v_b_A| A 在所有选中的行尾添加同样的文本
------------------------------------------------------------------------------
*Q_ai* 插入模式键

|insert-index| 插入模式命令的索引,以字母顺序排列

离开插入模式:
|i_<Esc>| <Esc> 结束插入模式,回到普通模式
|i_CTRL-C| CTRL-C 同 <Esc>, 但不使用缩写
|i_CTRL-O| CTRL-O {command} 执行命令 {command} 并回到插入模式

移动:
|i_<Up>| 光标键 左/右/上/下 移动光标
|i_<S-Left>| shift-left/right 左/右 移动一个单词
|i_<S-Up>| shift-up/down 向后/前一个屏幕
|i_<End>| <End> 光标至本行的末字符后
|i_<Home>| <Home> 光标至本行的首字符
------------------------------------------------------------------------------
*Q_ss* 插入模式特别键

|i_CTRL-V| CTRL-V {char}.. 按表面意义插入字符, 或插入十进制数代表
的字节
|i_<NL>| <NL> 或 <CR> 或 CTRL-M 或 CTRL-J
开始新行
|i_CTRL-E| CTRL-E 插入光标下方的字符
|i_CTRL-Y| CTRL-Y 插入光标上方的字符

|i_CTRL-A| CTRL-A 插入上次插入的文本
|i_CTRL-@| CTRL-@ 插入上次插入的文本并结束
插入模式
|i_CTRL-R| CTRL-R {0-9a-z%#:.-="} 插入寄存器的内容
|i_CTRL-N| CTRL-N 插入光标位置前下一个匹配的标识符
|i_CTRL-P| CTRL-P 插入光标位置前上一个匹配的标识符
????
|i_CTRL-X| CTRL-X ... 以各种方式完成光标前的单词

|i_<BS>| <BS> or CTRL-H 删除光标前的一个字符
|i_<Del>| <Del> 删除光标下的一个字符
|i_CTRL-W| CTRL-W 删除光标前的一个单词
|i_CTRL-U| CTRL-U 删除当前行的所有字符
|i_CTRL-T| CTRL-T 在当前行首插入一个以位宽度
|i_CTRL-D| CTRL-D 从当前行首删除一个以位宽度
|i_0_CTRL-D| 0 CTRL-D 删除当前行的所有缩进
|i_^_CTRL-D| ^ CTRL-D 删除当前行的所有缩进, 恢复下一行的缩进
------------------------------------------------------------------------------
*Q_di* 二合字母

|:dig| :dig[raphs] 显示当前二合字母列表
|:dig| :dig[raphs] {char1}{char2} {number} ...
加入一个或多个二合字母到上述列表中

在插入或命令行方式下:
|i_CTRL-K| CTRL-K {char1} {char2}
键入二合字母
|i_digraph| {char1} <BS> {char2}
若 'digraph' 选项被设置则键入二合字母
------------------------------------------------------------------------------
*Q_si* 特殊插入

|:r| :r [file] 将文件 [file] 的内容插入到光标之下
|:r!| :r! {command} 将命令 {command} 的的标准输出插入到光标之下
------------------------------------------------------------------------------
*Q_de* 删除文本

|x| N x 删除光标之下及之后的 N 个字符
|<Del>| N <Del> 删除光标之下及之后的 N 个字符
|X| N X 删除光标之前的 N 个字符
|d| N d{motion} 删除移动 {motion} 覆盖的文本
|v_d| {visual}d 删除加亮的文本
|dd| N dd 删除 N 行
|D| N D 删除至行尾 (以及下面 N-1 行)
|J| N J 合并 N-1 行 (删除 <EOL>)
|v_J| {visual}J 合并高亮的行
|gJ| N gJ 如 "J", 但不插入空格
|v_gJ| {visual}gJ 如 "{visual}J", 但不插入空格
|:d| :[range]d [x] 删除范围 [range] 覆盖的行 [存入寄存器 x]
------------------------------------------------------------------------------
*Q_cm* 拷贝和移动文本

|quote| "{char} 在接下来的删除, 剪切, 或放置命令中使用寄存器 {char}
|:reg| :reg 显示所有寄存器的内容
|:reg| :reg {arg} 显示寄存器 {arg} 的内容
|y| N y{motion} 将动作 {motion} 覆盖的文本剪切至一个寄存器
|v_y| {visual}y 将加亮的文本剪切至一个寄存器
|yy| N yy 剪切 N 行至寄存器
|Y| N Y 剪切 N 行至寄存器
|p| N p 将一个寄存器的内容放置在光标位置后 (N times)
|P| N P 将一个寄存器的内容放置在光标位置前 (N times)
|]p| N ]p 如 p, 但调整当前行的缩进
|[p| N [p 如 P, 但调整当前行的缩进
|gp| N gp 如 p, 当将光标留在新文本之后
|gP| N gP 如 P, 当将光标留在新文本之后
------------------------------------------------------------------------------
*Q_ch* 改变文本

|r| N r{char} 以 {char} 替换 N 个字符
|gr| N gr{char} 替换 N 个字符并不影响布局
|R| N R 进入替换模式 (重复键入的文本 N 次)
|gR| N gR 进入虚替换模式: 如替换模式但
不影响布局
|v_b_r| {visual}r{char}
在可视块模式下: 以字符 {char} 替换被选中文本
的每个字符

(改变 = 删除文本并进入插入模式)
|c| N c{motion} 改变动作 {motion} 覆盖的文本
|v_c| {visual}c 改变高亮的文本
|cc| N cc 改变 N 行
|S| N S 改变 N 行
|C| N C 改至行尾 (及 N-1 后续行)
|s| N s 改变 N 个字符
|v_b_c| {visual}c 在可视块模式下: 用键入的文本改变选中文本
的每一行
|v_b_C| {visual}C 在可视块模式下: 用键入的文本改变选中各行
直至每行的行末

|~| N ~ 翻转 N 个字符的大小写并前进光标
|v_~| {visual}~ 翻转高亮文本的大小写
|v_u| {visual}u 该高亮的文本为小写
|v_U| {visual}U 该高亮的文本为大写
|g~| g~{motion} 将动作 {motion} 覆盖的文本翻转大小写
|gu| gu{motion} 将动作 {motion} 覆盖的文本置为小写
|gU| gU{motion} 将动作 {motion} 覆盖的文本置为大写
|v_g?| {visual}g? 对高亮的文本做 rot13 编码
|g?| g?{motion} 对动作 {motion} 覆盖的文本做 rot13 编码

|CTRL-A| N CTRL-A 将光标所在处或其后的数值增加 N
|CTRL-X| N CTRL-X 将光标所在处或其后的数值减少 N

|<| N <{motion} 将动作 {motion} 覆盖的所有行向左移动一个
移位宽度
|<<| N << 向左将 N 行移动一个移位宽度
|>| N >{motion} 将动作 {motion} 覆盖的所有行向左移动一个
移位宽度
|>>| N >> 向左将 N 行移动一个移位宽度
|gq| N gq{motion} 排列动作 {motion} 覆盖的所有行的格式, 将其
限于 'textwidth' 长度之内
|:ce| :[range]ce[nter] [width]
将范围 [range] 包括的行置中
|:le| :[range]le[ft] [indent]
左对齐范围 [range] 中的行 (使用 [indent])
|:ri| :[range]ri[ght] [width]
右对齐范围 [range] 中的行
------------------------------------------------------------------------------

代码:
*Q_co* 复杂改动

|!| N !{motion}{command}<CR>
将动作覆盖的行用命令 {command} 过滤
|!!| N !!{command}<CR>
用命令 {command} 过滤 N 行
|v_!| {visual}!{command}<CR>
将加亮的行用命令 {command} 过滤
|:range!| :[range]! {command}<CR>
将范围 [range] 包括的行用命令 {command} 过滤
|=| N ={motion}
将动作覆盖的行用 'equalprg' 过滤
|==| N == 用 'equalprg' 过滤 N 行
|v_=| {visual}=
将加亮的行用 'equalprg' 过滤
|:s| :[range]s[ubstitute]/{pattern}/{string}/[g][c]
以 {string} 替换范围 [range] 包括的行中的 {pattern} ;
与 [g] 共用, 替换所有的出现的 {pattern};
与 [c] 公用, 确认每一次替换
|:s| :[range]s[ubstitute] [g][c]
以新的范围和选项重复上一次的 ":s" 命令
|&| & 不带选项在当前行上重复上一次的 ":s" 命令
|:ret| :[range]ret[ab][!] [tabstop]
置 'tabstop' 为新值并依据此值调整空白字符
------------------------------------------------------------------------------
*Q_vi* 可视模式

|visual-index| 可视模式命令列表

|v| v 开始加亮字符 } 移动光标或使用
|V| V 开始以行方式加亮文本 } 操作符来影响被
|CTRL-V| CTRL-V 开始以块方式加亮文本 } 加亮的文本
|v_o| o 与高亮区域的开始交换光标位置
|gv| gv 以上一次的可视区域开始加亮文本
|v_v| v 开始以字符方式加亮或停止加亮
|v_V| V 开始以行方式加亮或停止加亮
|v_CTRL-V| CTRL-V 开始以块方式加亮或停止加亮
------------------------------------------------------------------------------
*Q_to* 文本对象 (仅适用于可视模式或在操作符后)

|v_aw| N aw 选择 "一个单词"
|v_iw| N iw 选择 "内单词"
|v_aW| N aW 选择 "一个 |WORD|"
|v_iW| N iW 选择 "内 |WORD|"
|v_as| N as 选择 "一个句子"
|v_is| N is 选择 "内句子"
|v_ap| N ap 选择 "选择一个段落"
|v_ip| N ip 选择 "内段落"
|v_ab| N ab 选择 "一个块" (从 "[(" 至 "])")
|v_ib| N ib 选择 "内块" (从 "[(" 到 "])")
|v_aB| N aB 选择 "一个 Block" (从 "[{" 到 "]}")
|v_iB| N iB 选择 "内 Block" (从 "[{" 到 "]}")
------------------------------------------------------------------------------
*Q_re* 重复命令

|.| N . 重复最近一次改动 (将次数改为 N)
|q| q{a-z} 将键入的字符录入寄存器 {a-z}
|q| q{A-Z} 将键入的字符添加进寄存器 {a-z}
|q| q 终止纪录
|@| N @{a-z} 执行寄存器 {a-z} 的内容(N 次)
|@@| N @@ 重复上次的 @{a-z} 操作 (N 次)
|:@| :@{a-z} 将寄存器 {a-z} 的内容当作一个 Ex
命令来执行
|:@@| :@@ 重复上次的 :@{a-z} 操作
|:g| :[range]g[lobal]/{pattern}/[cmd]
对 [range] 内所有匹配 {pattern} 的行执行 Ex 命令 [cmd]
(缺省: ":p")
|:g| :[range]g[lobal]!/{pattern}/[cmd]
对 [range] 内所有不匹配 {pattern} 的行执行 Ex 命令 [cmd]
(缺省: ":p")
|:so| :so[urce] {file}
从文件 {file} 读入 Ex 命令
|:so| :so[urce]! {file}
从文件 {file} 读入 Vim 命令
|:sl| :sl[eep] [sec]
在 [sec] 秒钟内任何事也不做
|gs| N gs 睡 N 秒
------------------------------------------------------------------------------
*Q_km* 键盘映射

|:map| :ma[p] {lhs} {rhs} 在普通及可视模式下将 {rhs} 映射为 {lhs}
|:map!| :ma[p]! {lhs} {rhs} 在插入及命令行模式下将 {rhs} 映射为 {lhs}
|:noremap| :no[remap][!] {lhs} {rhs}
如 ":map", 但不能为 {rhs} 做重映射
|:unmap| :unm[ap] {lhs} 清除普通及可视模式下 {lhs} 的映射
|:unmap!| :unm[ap]! {lhs} 清除插入及命令行模式下 {lhs} 的映射
|:map_l| :ma[p] [lhs] 列出普通及可视模式下以 [lhs] 开始的映射.
|:map_l!| :ma[p]! [lhs] 列出插入及命令行模式下以 [lhs] 开始的映射.
|:cmap| :cmap/:cunmap/:cnoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
命令行模式
|:imap| :imap/:iunmap/:inoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
插入行模式
|:nmap| :nmap/:nunmap/:nnoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
普通行模式
|:vmap| :vmap/:vunmap/:vnoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
可视模式
|:omap| :omap/:ounmap/:onoremap
如 ":map!"/":unmap!"/":noremap!" 但仅作用于
Operator-pending 模式
|:mapc| :mapc[lear] 清除通及可视模式下的映射
|:mapc| :mapc[lear]! 清除插入及命令行模式下的映射
|:imapc| :imapc[lear] 清除插入模式下的映射
|:vmapc| :vmapc[lear] 清除可视模式下的映射
|:omapc| :omapc[lear] 清除 Operator-pending 模式下的映射
|:nmapc| :nmapc[lear] 清除普通模式下的映射
|:cmapc| :cmapc[lear] 清除命令行模式下的映射
|:mkexrc| :mk[exrc][!] [file] 将当前的键盘映射, 缩写, 及设置
写入文件 [file] (缺省: ".exrc";
使用 ! 覆盖文件)
|:mkvimrc| :mkv[imrc][!] [file]
如 ":mkexrc", 但缺省为 ".vimrc"
|:mksession| :mks[ession][!] [file]
如 ":mkvimrc", 但同时存储当前文件, 窗口
等等信息, 使得用户将来可以继续当前对话.
------------------------------------------------------------------------------
*Q_ab* 缩写

|:abbreviate| :ab[breviate] {lhs} {rhs} 为 {rhs} 加入缩写 {lhs}
|:abbreviate| :ab[breviate] {lhs} 显示 {lhs} 以开始的缩写
|:abbreviate| :ab[breviate] 显示所有缩写
|:unabbreviate| :una[bbreviate] {lhs} 删除所有 {lhs} 代表的缩写
|:noreabbrev| :norea[bbrev] [lhs] [rhs] 同 ":ab", but don't remap [rhs]
|:iabbrev| :iab/:iunab/:inoreab 同 ":ab", 但仅适用于插入模式
|:cabbrev| :cab/:cunab/:cnoreab 同 ":ab", 但仅适用于命令行模式
|:abclear| :abc[lear] 清除所有缩写
|:cabclear| :cabc[lear] 清除所有命令行模式缩写
|:iabclear| :iabc[lear] 清除所有插入模式缩写
------------------------------------------------------------------------------
*Q_op* 选项

|:set| :se[t] 显示所有被改动的选项
|:set| :se[t] all 显示所有非 termcap 选项
|:set| :se[t] termcap 显示所有 termcap 选项
|:set| :se[t] {option} 置布尔选项 (开启),
显示字符穿或数字选项.
|:set| :se[t] no{option} 复位布尔选项 (关闭).
|:set| :se[t] inv{option} invert boolean option.
|:set| :se[t] {option}={value} Set string/number option to {value}.
|:set| :se[t] {option}+={value} append {value} to string option, add
{value} to number option
|:set| :se[t] {option}-={value} remove {value} to string option,
subtract {value} from number option
|:set| :se[t] {option}? 显示 {option} 的值
|:set| :se[t] {option}& Reset {option} to its default value.

|:setlocal| :setl[ocal] like ":set" but set the local value
for options that have one
|:setglobal| :setg[lobal] like ":set" but set the global value
of a local option

|:fix| :fix[del] Set value of 't_kD' according to
value of 't_kb'.
|:options| :opt[ions] Open a new window to view and set
options, grouped by functionality,
a one line explanation and links to
the help.

各选项的简短说明: *option-list*
|'aleph'| |'al'| ASCII code of the letter Aleph (Hebrew)
|'allowrevins'| |'ari'| allow CTRL-_ in Insert and Command-line mode
|'altkeymap'| |'akm'| for default second language (Farsi/Hebrew)
|'ambiwidth'| |'ambw'| what to do with Unicode chars of ambiguous width
|'antialias'| |'anti'| Mac OS X: use smooth, antialiased fonts
|'autochdir'| |'acd'| change directory to the file in the current window
|'arabic'| |'arab'| for Arabic as a default second language
|'arabicshape'| |'arshape'| do shaping for Arabic characters
|'autoindent'| |'ai'| take indent for new line from previous line
|'autoread'| |'ar'| autom. read file when changed outside of Vim
|'autowrite'| |'aw'| automatically write file if changed
|'autowriteall'| |'awa'| as 'autowrite', but works with more commands
|'background'| |'bg'| "dark" or "light", used for highlight colors
|'backspace'| |'bs'| how backspace works at start of line
|'backup'| |'bk'| keep backup file after overwriting a file
|'backupcopy'| |'bkc'| make backup as a copy, don't rename the file
|'backupdir'| |'bdir'| list of directories for the backup file
|'backupext'| |'bex'| extension used for the backup file
|'backupskip'| |'bsk'| no backup for files that match these patterns
|'balloondelay'| |'bdlay'| delay in mS before a balloon may pop up
|'ballooneval'| |'beval'| switch on balloon evaluation
|'binary'| |'bin'| read/write/edit file in binary mode
|'bioskey'| |'biosk'| MS-DOS: use bios calls for input characters
|'bomb'| prepend a Byte Order Mark to the file
|'breakat'| |'brk'| characters that may cause a line break
|'browsedir'| |'bsdir'| which directory to start browsing in
|'bufhidden'| |'bh'| what to do when buffer is no longer in window
|'buflisted'| |'bl'| whether the buffer shows up in the buffer list
|'buftype'| |'bt'| special type of buffer
|'casemap'| |'cmp'| specifies how case of letters is changed
|'cdpath'| |'cd'| list of directories searched with ":cd"
|'cedit'| key used to open the command-line window
|'charconvert'| |'ccv'| expression for character encoding conversion
|'cindent'| |'cin'| do C program indenting
|'cinkeys'| |'cink'| keys that trigger indent when 'cindent' is set
|'cinoptions'| |'cino'| how to do indenting when 'cindent' is set
|'cinwords'| |'cinw'| words where 'si' and 'cin' add an indent
|'clipboard'| |'cb'| use the clipboard as the unnamed register
|'cmdheight'| |'ch'| number of lines to use for the command-line
|'cmdwinheight'| |'cwh'| height of the command-line window
|'columns'| |'co'| number of columns in the display
|'comments'| |'com'| patterns that can start a comment line
|'commentstring'| |'cms'| template for comments; used for fold marker
|'compatible'| |'cp'| behave Vi-compatible as much as possible
|'complete'| |'cpt'| specify how Insert mode completion works
|'confirm'| |'cf'| ask what to do about unsaved/read-only files
|'conskey'| |'consk'| get keys directly from console (MS-DOS only)
|'copyindent'| |'ci'| make 'autoindent' use existing indent structure
|'cpoptions'| |'cpo'| flags for Vi-compatible behavior
|'cscopepathcomp'| |'cspc'| how many components of the path to show
|'cscopeprg'| |'csprg'| command to execute cscope
|'cscopequickfix'| |'csqf'| use quickfix window for cscope results
|'cscopetag'| |'cst'| use cscope for tag commands
|'cscopetagorder'| |'csto'| determines ":cstag" search order
|'cscopeverbose'| |'csverb'| give messages when adding a cscope database
|'debug'| set to "msg" to see all error messages
|'define'| |'def'| pattern to be used to find a macro definition
|'delcombine'| |'deco'| delete combining characters on their own
|'dictionary'| |'dict'| list of file names used for keyword completion
|'diff'| use diff mode for the current window
|'diffexpr'| |'dex'| expression used to obtain a diff file
|'diffopt'| |'dip'| options for using diff mode
|'digraph'| |'dg'| enable the entering of digraphs in Insert mode
|'directory'| |'dir'| list of directory names for the swap file
|'display'| |'dy'| list of flags for how to display text
|'eadirection'| |'ead'| in which direction 'equalalways' works
|'edcompatible'| |'ed'| toggle flags of ":substitute" command
|'encoding'| |'enc'| encoding used internally
|'endofline'| |'eol'| write <EOL> for last line in file
|'equalalways'| |'ea'| windows are automatically made the same size
|'equalprg'| |'ep'| external program to use for "=" command
|'errorbells'| |'eb'| ring the bell for error messages
|'errorfile'| |'ef'| name of the errorfile for the QuickFix mode
|'errorformat'| |'efm'| description of the lines in the error file
|'esckeys'| |'ek'| recognize function keys in Insert mode
|'eventignore'| |'ei'| autocommand events that are ignored
|'expandtab'| |'et'| use spaces when <Tab> is inserted
|'exrc'| |'ex'| read .vimrc and .exrc in the current directory
|'fileencoding'| |'fenc'| file encoding for multi-byte text
|'fileencodings'| |'fencs'| automatically detected character encodings
|'fileformat'| |'ff'| file format used for file I/O
|'fileformats'| |'ffs'| automatically detected values for 'fileformat'
|'filetype'| |'ft'| type of file, used for autocommands
|'fillchars'| |'fcs'| characters to use for displaying special items
|'fkmap'| |'fk'| Farsi keyboard mapping
|'foldclose'| |'fcl'| close a fold when the cursor leaves it
|'foldcolumn'| |'fdc'| width of the column used to indicate folds
|'foldenable'| |'fen'| set to display all folds open
|'foldexpr'| |'fde'| expression used when 'foldmethod' is "expr"
|'foldignore'| |'fdi'| ignore lines when 'foldmethod' is "indent"
|'foldlevel'| |'fdl'| close folds with a level higher than this
|'foldlevelstart'| |'fdls'| 'foldlevel' when starting to edit a file
|'foldmarker'| |'fmr'| markers used when 'foldmethod' is "marker"
|'foldmethod'| |'fdm'| folding type
|'foldminlines'| |'fml'| minimum number of lines for a fold to be closed
|'foldnestmax'| |'fdn'| maximum fold depth
|'foldopen'| |'fdo'| for which commands a fold will be opened
|'foldtext'| |'fdt'| expression used to display for a closed fold
|'formatoptions'| |'fo'| how automatic formatting is to be done
|'formatprg'| |'fp'| name of external program used with "gq" command
|'gdefault'| |'gd'| the ":substitute" flag 'g' is default on
|'grepformat'| |'gfm'| format of 'grepprg' output
|'grepprg'| |'gp'| program to use for ":grep"
|'guicursor'| |'gcr'| GUI: settings for cursor shape and blinking
|'guifont'| |'gfn'| GUI: Name(s) of font(s) to be used
|'guifontset'| |'gfs'| GUI: Names of multi-byte fonts to be used
|'guifontwide'| |'gfw'| list of font names for double-wide characters
|'guiheadroom'| |'ghr'| GUI: pixels room for window decorations
|'guioptions'| |'go'| GUI: Which components and options are used
|'guipty'| GUI: try to use a pseudo-tty for ":!" commands
|'helpfile'| |'hf'| full path name of the main help file
|'helpheight'| |'hh'| minimum height of a new help window
|'helplang'| |'hlg'| preferred help languages
|'hidden'| |'hid'| don't unload buffer when it is |abandon|ed
|'highlight'| |'hl'| sets highlighting mode for various occasions
|'hlsearch'| |'hls'| highlight matches with last search pattern
|'history'| |'hi'| number of command-lines that are remembered
|'hkmap'| |'hk'| Hebrew keyboard mapping
|'hkmapp'| |'hkp'| phonetic Hebrew keyboard mapping
|'icon'| let Vim set the text of the window icon
|'iconstring'| string to use for the Vim icon text
|'ignorecase'| |'ic'| ignore case in search patterns
|'imactivatekey'| |'imak'| key that activates the X input method
|'imcmdline'| |'imc'| use IM when starting to edit a command line
|'imdisable'| |'imd'| do not use the IM in any mode
|'iminsert'| |'imi'| use :lmap or IM in Insert mode
|'imsearch'| |'ims'| use :lmap or IM when typing a search pattern
|'include'| |'inc'| pattern to be used to find an include file
|'includeexpr'| |'inex'| expression used to process an include line
|'incsearch'| |'is'| highlight match while typing search pattern
|'indentexpr'| |'inde'| expression used to obtain the indent of a line
|'indentkeys'| |'indk'| keys that trigger indenting with 'indentexpr'
|'infercase'| |'inf'| adjust case of match for keyword completion
|'insertmode'| |'im'| start the edit of a file in Insert mode
|'isfname'| |'isf'| characters included in file names and pathnames
|'isident'| |'isi'| characters included in identifiers
|'iskeyword'| |'isk'| characters included in keywords
|'isprint'| |'isp'| printable characters
|'joinspaces'| |'js'| two spaces after a period with a join command
|'key'| encryption key
|'keymap'| |'kmp'| name of a keyboard mapping
|'keymodel'| |'km'| enable starting/stopping selection with keys
|'keywordprg'| |'kp'| program to use for the "K" command
|'langmap'| |'lmap'| alphabetic characters for other language mode
|'langmenu'| |'lm'| language to be used for the menus
|'laststatus'| |'ls'| tells when last window has status lines
|'lazyredraw'| |'lz'| don't redraw while executing macros
|'linebreak'| |'lbr'| wrap long lines at a blank
|'lines'| number of lines in the display
|'linespace'| |'lsp'| number of pixel lines to use between characters
|'lisp'| automatic indenting for Lisp
|'lispwords'| |'lw'| words that change how lisp indenting works
|'list'| show <Tab> and <EOL>
|'listchars'| |'lcs'| characters for displaying in list mode
|'loadplugins'| |'lpl'| load plugin scripts when starting up
|'magic'| changes special characters in search patterns
|'makeef'| |'mef'| name of the errorfile for ":make"
|'makeprg'| |'mp'| program to use for the ":make" command
|'matchpairs'| |'mps'| pairs of characters that "%" can match
|'matchtime'| |'mat'| tenths of a second to show matching paren
|'maxfuncdepth'| |'mfd'| maximum recursive depth for user functions
|'maxmapdepth'| |'mmd'| maximum recursive depth for mapping
|'maxmem'| |'mm'| maximum memory (in Kbyte) used for one buffer
|'maxmemtot'| |'mmt'| maximum memory (in Kbyte) used for all buffers
|'menuitems'| |'mis'| maximum number of items in a menu
|'modeline'| |'ml'| recognize modelines at start or end of file
|'modelines'| |'mls'| number of lines checked for modelines
|'modifiable'| |'ma'| changes to the text are not possible
|'modified'| |'mod'| buffer has been modified
|'more'| pause listings when the whole screen is filled
|'mouse'| enable the use of mouse clicks
|'mousefocus'| |'mousef'| keyboard focus follows the mouse
|'mousehide'| |'mh'| hide mouse pointer while typing
|'mousemodel'| |'mousem'| changes meaning of mouse buttons
|'mouseshape'| |'mouses'| shape of the mouse pointer in different modes
|'mousetime'| |'mouset'| max time between mouse double-click
|'nrformats'| |'nf'| number formats recognized for CTRL-A command
|'number'| |'nu'| print the line number in front of each line
|'osfiletype'| |'oft'| operating system-specific filetype information
|'paragraphs'| |'para'| nroff macros that separate paragraphs
|'paste'| allow pasting text
|'pastetoggle'| |'pt'| key code that causes 'paste' to toggle
|'patchexpr'| |'pex'| expression used to patch a file
|'patchmode'| |'pm'| keep the oldest version of a file
|'path'| |'pa'| list of directories searched with "gf" et.al.
|'preserveindent'| |'pi'| preserve the indent structure when reindenting
|'previewheight'| |'pvh'| height of the preview window
|'previewwindow'| |'pvw'| identifies the preview window
|'printdevice'| |'pdev'| name of the printer to be used for :hardcopy
|'printencoding'| |'penc'| encoding to be used for printing
|'printexpr'| |'pexpr'| expression used to print PostScript for :hardcopy
|'printfont'| |'pfn'| name of the font to be used for :hardcopy
|'printheader'| |'pheader'| format of the header used for :hardcopy
|'printoptions'| |'popt'| controls the format of :hardcopy output
|'readonly'| |'ro'| disallow writing the buffer
|'remap'| allow mappings to work recursively
|'report'| threshold for reporting nr. of lines changed
|'restorescreen'| |'rs'| Win32: restore screen when exiting
|'revins'| |'ri'| inserting characters will work backwards
|'rightleft'| |'rl'| window is right-to-left oriented
|'rightleftcmd'| |'rlc'| commands for which editing works right-to-left
|'ruler'| |'ru'| show cursor line and column in the status line
|'rulerformat'| |'ruf'| custom format for the ruler
|'runtimepath'| |'rtp'| list of directories used for runtime files
|'scroll'| |'scr'| lines to scroll with CTRL-U and CTRL-D
|'scrollbind'| |'scb'| scroll in window as other windows scroll
|'scrolljump'| |'sj'| minimum number of lines to scroll
|'scrolloff'| |'so'| minimum nr. of lines above and below cursor
|'scrollopt'| |'sbo'| how 'scrollbind' should behave
|'sections'| |'sect'| nroff macros that separate sections
|'secure'| secure mode for reading .vimrc in current dir
|'selection'| |'sel'| what type of selection to use
|'selectmode'| |'slm'| when to use Select mode instead of Visual mode
|'sessionoptions'| |'ssop'| options for |:mksession|
|'shell'| |'sh'| name of shell to use for external commands
|'shellcmdflag'| |'shcf'| flag to shell to execute one command
|'shellpipe'| |'sp'| string to put output of ":make" in error file
|'shellquote'| |'shq'| quote character(s) for around shell command
|'shellredir'| |'srr'| string to put output of filter in a temp file
|'shellslash'| |'ssl'| use forward slash for shell file names
|'shelltype'| |'st'| Amiga: influences how to use a shell
|'shellxquote'| |'sxq'| like 'shellquote', but include redirection
|'shiftround'| |'sr'| round indent to multiple of shiftwidth
|'shiftwidth'| |'sw'| number of spaces to use for (auto)indent step
|'shortmess'| |'shm'| list of flags, reduce length of messages
|'shortname'| |'sn'| non-MS-DOS: Filenames assumed to be 8.3 chars
|'showbreak'| |'sbr'| string to use at the start of wrapped lines
|'showcmd'| |'sc'| show (partial) command in status line
|'showfulltag'| |'sft'| show full tag pattern when completing tag
|'showmatch'| |'sm'| briefly jump to matching bracket if insert one
|'showmode'| |'smd'| message on status line to show current mode
|'sidescroll'| |'ss'| minimum number of columns to scroll horizontal
|'sidescrolloff'| |'siso'| min. nr. of columns to left and right of cursor
|'smartcase'| |'scs'| no ignore case when pattern has uppercase
|'smartindent'| |'si'| smart autoindenting for C programs
|'smarttab'| |'sta'| use 'shiftwidth' when inserting <Tab>
|'softtabstop'| |'sts'| number of spaces that <Tab> uses while editing
|'splitbelow'| |'sb'| new window from split is below the current one
|'splitright'| |'spr'| new window is put right of the current one
|'startofline'| |'sol'| commands move cursor to first blank in line
|'statusline'| |'stl'| custom format for the status line
|'suffixes'| |'su'| suffixes that are ignored with multiple match
|'suffixesadd'| |'sua'| suffixes added when searching for a file
|'swapfile'| |'swf'| whether to use a swapfile for a buffer
|'swapsync'| |'sws'| how to sync the swap file
|'switchbuf'| |'swb'| sets behavior when switching to another buffer
|'syntax'| |'syn'| syntax to be loaded for current buffer
|'tabstop'| |'ts'| number of spaces that <Tab> in file uses
|'tagbsearch'| |'tbs'| use binary searching in tags files
|'taglength'| |'tl'| number of significant characters for a tag
|'tagrelative'| |'tr'| file names in tag file are relative
|'tags'| |'tag'| list of file names used by the tag command
|'tagstack'| |'tgst'| push tags onto the tag stack
|'term'| name of the terminal
|'termbidi'| |'tbidi'| terminal takes care of bi-directionality
|'termencoding'| |'tenc'| character encoding used by the terminal
|'terse'| shorten some messages
|'textauto'| |'ta'| obsolete, use 'fileformats'
|'textmode'| |'tx'| obsolete, use 'fileformat'
|'textwidth'| |'tw'| maximum width of text that is being inserted
|'thesaurus'| |'tsr'| list of thesaurus files for keyword completion
|'tildeop'| |'top'| tilde command "~" behaves like an operator
|'timeout'| |'to'| time out on mappings and key codes
|'timeoutlen'| |'tm'| time out time in milliseconds
|'title'| let Vim set the title of the window
|'titlelen'| percentage of 'columns' used for window title
|'titleold'| old title, restored when exiting
|'titlestring'| string to use for the Vim window title
|'toolbar'| |'tb'| GUI: which items to show in the toolbar
|'toolbariconsize'| |'tbis'| size of the toolbar icons (for GTK 2 only)
|'ttimeout'| time out on mappings
|'ttimeoutlen'| |'ttm'| time out time for key codes in milliseconds
|'ttybuiltin'| |'tbi'| use built-in termcap before external termcap
|'ttyfast'| |'tf'| indicates a fast terminal connection
|'ttymouse'| |'ttym'| type of mouse codes generated
|'ttyscroll'| |'tsl'| maximum number of lines for a scroll
|'ttytype'| |'tty'| alias for 'term'
|'undolevels'| |'ul'| maximum number of changes that can be undone
|'updatecount'| |'uc'| after this many characters flush swap file
|'updatetime'| |'ut'| after this many milliseconds flush swap file
|'verbose'| |'vbs'| give informative messages
|'viewdir'| |'vdir'| directory where to store files with :mkview
|'viewoptions'| |'vop'| specifies what to save for :mkview
|'viminfo'| |'vi'| use .viminfo file upon startup and exiting
|'virtualedit'| |'ve'| when to use virtual editing
|'visualbell'| |'vb'| use visual bell instead of beeping
|'warn'| warn for shell command when buffer was changed
|'weirdinvert'| |'wi'| for terminals that have weird inversion method
|'whichwrap'| |'ww'| allow specified keys to cross line boundaries
|'wildchar'| |'wc'| command-line character for wildcard expansion
|'wildcharm'| |'wcm'| like 'wildchar' but also works when mapped
|'wildignore'| |'wig'| files matching these patterns are not completed
|'wildmenu'| |'wmnu'| use menu for command line completion
|'wildmode'| |'wim'| mode for 'wildchar' command-line expansion
|'winaltkeys'| |'wak'| when the windows system handles ALT keys
|'winheight'| |'wh'| minimum number of lines for the current window
|'winfixheight'| |'wfh'| keep window height when opening/closing windows
|'winminheight'| |'wmh'| minimum number of lines for any window
|'winminwidth'| |'wmw'| minimal number of columns for any window
|'winwidth'| |'wiw'| minimal number of columns for current window
|'wrap'| long lines wrap and continue on the next line
|'wrapmargin'| |'wm'| chars from the right where wrapping starts
|'wrapscan'| |'ws'| searches wrap around the end of the file
|'write'| writing to a file is allowed
|'writeany'| |'wa'| write to file with no need for "!" override
|'writebackup'| |'wb'| make a backup before overwriting a file
|'writedelay'| |'wd'| delay this many msec for each char (for debug)
------------------------------------------------------------------------------
*Q_ur* 撤销/重复 命令

|u| N u 撤销最近的 N 此改动
|CTRL-R| N CTRL-R 重复最近的 N 个被撤销的改动
|U| U 恢复最近被改动的行
------------------------------------------------------------------------------
*Q_et* 外部命令

|:shell| :sh[ell] 开启一个 shell
|:!| :!{command} 通过一个 shell 执行命令 {command}
|K| K 以 'keywordprg' 程序 (缺省: "man")查光标下的关键字
------------------------------------------------------------------------------
*Q_qf* Quickfix commands

|:cc| :cc [nr] 显示错误 [nr] (缺省为同一错误)
|:cnext| :cn 显示下一个错误
|:cprevious| :cp 显示上一个错误
|:clist| :cl 列出所有错误
|:cfile| :cf 从文件 'errorfile' 读入错误
|:cquit| :cq 退出不保存并返回错误代码 (至编译器)
|:make| :make [args] 启动 make, 读入错误, 并跳转至第一个错误
|:grep| :gr[ep] [args] 执行 'grepprg' 程序以找出匹配并跳转至
第一个匹配
------------------------------------------------------------------------------
*Q_vc* 其他移动

|CTRL-L| CTRL-L 清除并重画屏幕
|CTRL-G| CTRL-G 先是当前文件名 (包括路径) 和光标位置
|ga| ga 以十进制,十六进制和八进制显示当前光标下的字符
的ASCII值
|g_CTRL-G| g CTRL-G 先是当前光标的列,行,以及字符位置
|CTRL-C| CTRL-C 在查找中: 中断查找
|dos-CTRL-Break| CTRL-Break MS-DOS: 在查找中: 中断查找
|<Del>| <Del> 当输入一个次数时: 删除前一个输入字符
|:version| :ve[rsion] 显示版本信息
|:mode| :mode N MS-DOS: 至屏幕模式为 N (数字, C80,
C4350, 等.)
|:normal| :norm[al][!] {commands}
执行普通模式命令
|Q| Q 切换至 "Ex" 模式

|:redir| :redir >{file} 重定向信息至文件 {file}
|:silent| :silent[!] {command} 沉默的执行 {command} 命令
|:confirm| :confirm {command} 退出, 写入, 等., 询问关于为保存的改动
或者只读文件.
|:browse| :browse {command} 打开/读入/写入 文件, 使用一个
文件选择对话框
------------------------------------------------------------------------------
*Q_ce* 命令行编辑

|c_<Esc>| <Esc> 放弃命令行 (如果 'wildchar' 通配符是
<Esc>, 键入两次)

|c_CTRL-V| CTRL-V {char} 按字面插入 {char}
|c_CTRL-V| CTRL-V {number} 输入10进制数表示的字符 (可达3个数位)
|c_CTRL-K| CTRL-K {char1} {char2}
键入二合字母 (参见 |Q_di|)
|c_CTRL-R| CTRL-R {0-9a-z"%#:-=}
插入指定寄存器的内容

|c_<Left>| <Left>/<Right> 光标左移/右移
|c_<S-Left>| <S-Left>/<S-Right> 光标左移/右移一个单词
|c_CTRL-B| CTRL-B/CTRL-E 光标移动至命令行行首/行尾

|c_<BS>| <BS> 删除光标前的字符
|c_<Del>| <Del> 删除光标下的字符
|c_CTRL-W| CTRL-W 删除光标前的单词
|c_CTRL-U| CTRL-U 删除所有字符

|c_<Up>| <Up>/<Down> 回忆以当前命令行开始的较早/较晚的命令
|c_<S-Up>| <S-Up>/<S-Down> 从命令行历史中回忆较早/较晚的命令
|:history| :his[tory] 显示命令行历史

上下文关联的命令行补全:

|c_wildchar| 'wildchar' (缺省: <Tab>)
根据光标前的命令行补全。如果有多个匹配,响铃
并显示第一个;继续 'wildchar' 将显示下一个
匹配。
|c_CTRL-D| CTRL-D 列出当前命令行所有可能的匹配
|c_CTRL-A| CTRL-A 插入当前命令行所有可能的匹配
|c_CTRL-L| CTRL-L 插入所有匹配当前模式的名字的最长的共同部分
|c_CTRL-N| CTRL-N 在 'wildchar' 之后存在多个匹配: 至下一匹配
|c_CTRL-P| CTRL-P 在 'wildchar' 之后存在多个匹配: 至上一匹配
------------------------------------------------------------------------------
*Q_ra* Ex 范围

|:range| , 分割两个行号
|:range| ; 同上, 但在解释第二个行号之前先至
光标与第一个行号代表的行

|:range| {number} 一个绝对行号
|:range| . 当前行
|:range| $ 本文件的最后一行
|:range| % 等同于 1,$ (整个文件)
|:range| * 等同于 '<,'> (可视区域)
|:range| 't 标记 t 的位置
|:range| /{pattern}[/] 下一个匹配 {pattern} 的行
|:range| ?{pattern}[?] 前一个匹配 {pattern} 的行

|:range| +[num] 在前面的行号上加 [num] (缺省: 1)
|:range| -[num] 从前面的行号里减 [num] (缺省: 1)
------------------------------------------------------------------------------
*Q_ex* 特殊 Ex 字符

|:bar| | 分割两个命令 (不适用于 ":global" 及 ":!")
|:quote| " 开始注释

|:_%| % 当前文件名 (仅当期望文件名时)
|:_#| #[num] alternate file 文件名 [num] (仅当期望文件名时)
注: 一下四项以字面意思键入; 并非特殊键!
|:<cword>| <cword> 光标下的 word (仅当期望文件名时)
|:<cWORD>| <cWORD> 光标下的 WORD (仅当期望文件名时)
|:<cfile>| <cfile> 光标下的文件名 (仅当期望文件名时)
|:<afile>| <afile> 供自动命令使用的文件名 (仅当期望文件名时)
|:<sfile>| <sfile> 一个被 ":source" 的文件的文件名, within that file (only
(仅当期望文件名时)

于 "%", "#", "<cfile>", "<sfile>" 或 "<afile>" 之后
|::p| :p 完整路径
|::h| :h 头 (除去文件名)
|::t| :t 尾 (仅使用文件名)
|::r| :r 根 (除去扩展名)
|::e| :e 扩展名
|::s| :s/{pat}/{repl}/ 以 {repl} 替换 {pat}
------------------------------------------------------------------------------
*Q_ed* 编辑一个文件

无 !: 若当前缓冲已被改动则失败
有 !: 放弃任何对当前缓冲的改动
|:edit_f| :e[dit][!] {file} 编辑 {file}.
|:edit| :e[dit][!] 重新载入当前文件
|:enew| :ene[w][!] 编辑一个无名的新缓冲
|:find| :fin[d][!] {file} 在 'path' 当中查找文件 {file} 并编辑之

|CTRL-^| N CTRL-^ 编辑 alternate file N (同 ":e #N").
|gf| gf or ]f 编辑光标下的文件名对应的文件
|:pwd| :pwd 显示当前目录名
|:cd| :cd [path] 将当前目录名变至 [path].
|:cd-| :cd - 回到上一次当前目录
|:file| :f[ile] 先是当前文件名及光标位置
|:file| :f[ile] {name} 至当前文件名为 {name}.
|:files| :files 显示 alternate file 的文件名.
------------------------------------------------------------------------------
*Q_fl* 使用参数列表 |argument-list|

|:args| :ar[gs] 显示参数列表, 当前文件显示在 "[]" 中
|:all| :all or :sall 为参数列表中的每个文件打开一个窗口
|:wn| :wn[ext][!] 写入文件并编辑下一个
|:wn| :wn[ext][!] {file} 写入 {file} 并编辑下一个文件, 除非
文件 {file} 已经存在. 使用 !, 覆盖
已存在的文件.
|:wN| :wN[ext][!] [file] 写入文件并编辑前一个文件

在当前窗口 新建窗口 ~
|:argument| :argu[ment] N :sar[gument] N 编辑文件 N
|:next| :n[ext] :sn[ext] 编辑下一个文件
|:next_f| :n[ext] {arglist} :sn[ext] {arglist} 定义新的文件列表并编辑
其中的第一个
|:Next| :N[ext] :sN[ext] 编辑前一个文件
|:first| :fir[st] :sfir[st] 编辑第一个文件
|:last| :la[st] :sla[st] 编辑最后一个文件
------------------------------------------------------------------------------
*Q_wq* 写入和退出

|:w| :[range]w[rite][!] 写入当前文件
|:w_f| :[range]w[rite] {file} 写入至文件 {file}, 除非其已经存在
|:w_f| :[range]w[rite]! {file} 写入至文件 {file}. 覆盖已存在的文件
|:w_a| :[range]w[rite][!] >> 添加至当前文件
|:w_a| :[range]w[rite][!] >> {file} 添加至 {file}.
|:w_c| :[range]w[rite] !{cmd} 执行命令 {cmd},以 [range] 代表的行
作为标准输入。
|:up| :[range]up[date][!] 如果当前文件被改动则写入
|:wall| :wa[ll][!] 写入所有被改动的缓冲区

|:q| :q[uit] 退出当前缓冲, 除非已经做了改动. 如果没有其它
非帮助的缓冲, 退出 Vim
|:q| :q[uit]! 强制退出当前缓冲, 放弃所有的改动. 如果没有其它
非帮助的缓冲, 退出 Vim
|:qa| :qa[ll] 退出 Vim, 除非作了改动
|:qa| :qa[ll]! 退出 Vim, 废除所有改动
|:cq| :cq 推出,不写入文件并返回错误代码

|:wq| :wq[!] 写入当前文件并退出
|:wq| :wq[!] {file} 写入文件 {file} 并退出
|:xit| :x[it][!] [file] 同 ":wq" 但是仅当有改动时写入
|ZZ| ZZ 同 ":x".
|ZQ| ZQ 同 ":q!".
|:xall| :xa[ll][!] or :wqall[!]
写入所有改动的缓冲并退出

|:stop| :st[op][!] 挂起 VIM 或开始一个新 shell. 如果设置了 'aw' 选项
并没有给出 [!] 则写入缓冲.
|CTRL-Z| CTRL-Z 同 ":stop"
------------------------------------------------------------------------------
*Q_st* 启动 VIM

|-vim| vim [options] 启动vim并开起一个空白缓冲
|-file| vim [options] {file} .. 启动并编辑一个或多个文件
|--| vim [options] - 从标准输入读入文件
|-tag| vim [options] -t {tag} 编辑于标签 {tag} 关联的文件
|-qf| vim [options] -q [fname] 以快速纠正模式开始编辑,
显示第一个错误.

Vim 参数:

|-gui| -g 启动 GUI (同时允许其他选项)

|-+| +[num] 至光标于第 [num] 行(缺省: 末行)
|-+c| +{command} 载入文件后执行命令 {command}
|-+/| +/{pat} {file} .. 至光标于第一次出现 {pat} 处
|-v| -v Vi 模式, 以普通模式起动 ex
|-e| -e Ex 模式, 以 Ex 模式启动 vim
|-R| -R 只读模式, 隐含 -n
|-m| -m 禁止修改 (重置 'write' 选项)
|-b| -b 二进制模式
|-l| -l lisp 模式
|-A| -A 阿拉伯模式 ('arabic' is set)
|-F| -F Farsi 模式 ('fkmap' 和 'rightleft' are set)
|-H| -H Hebrew 模式 ('hkmap' and 'rightleft' are set)
|-V| -V Verbose, 给出更多信息
|-C| -C 兼容, 设置 'compatible' 选项
|-N| -N 不兼容, 复位 'compatible' 选项
|-r| -r 给出交换文件列表
|-r| -r {file} .. 恢复中断的编辑
|-n| -n 不创建交换文件
|-o| -o [num] 打开 [num] 个窗口 (缺省: 每个文件一个窗口)
|-f| -f GUI: 前台进程, 不调用 fork
Amiga: do not restart VIM to open a window (for
e.g., mail)
|-s| -s {scriptin} 先从文件 {scriptin} 读入命令
|-w| -w {scriptout} 把键入的字符写进文件 {scriptout} (添加)
|-W| -W {scriptout} 把键入的字符写进文件 {scriptout} (覆盖)
|-T| -T {terminal} 设置终端名
|-d| -d {device} Amiga: open {device} to be used as a console
|-u| -u {vimrc} 从文件 {vimrc} 而非其它文件读入初始化命令
|-U| -U {gvimrc} 同上, 但用于启动 GUI 时
|-i| -i {viminfo} 从文件 {viminfo} 而不是其它文件读入 info
|---| -- 结束选项, 其余的参数都将是文件名
|--help| --help 显示参数列表并退出
|--version| --version 显示版本信息并退出
|--| - 从标准输入读入文件
------------------------------------------------------------------------------
*Q_ac* 自动命令

|viminfo-file| 在启动时读入寄存器, 标记, 历史记录, 退出时存储这些信息.

|:rviminfo| :rv[iminfo] [file] 从文件 [file] 读入 viminfo 信息
|:rviminfo| :rv[iminfo]! [file] 同上, 但覆盖已存在的信息
|:wviminfo| :wv[iminfo] [file] 向文件 [file] 中加入 viminfo 信息
|:wviminfo| :wv[iminfo]! [file] 向文件 [file] 中加入 viminfo 信息

|modeline| 当编辑一个文件时自动设定的选项

|modeline| vim:{set-arg}: .. 至于文件的第一行或最后一行
(参见 'ml' 选项), {set-arg} 被用于
":set" 命令的参数

|autocommand| 特定时间发生时自动执行命令

|:autocmd| :au 列出所由自动命令
|:autocmd| :au {event} 列出事件 {event} 的所由自动命令
|:autocmd| :au {event} {pat} 列出事件 {event} 的所由自动命令
并使用文件匹配 {pat}
|:autocmd| :au {event} {pat} {cmd} 为事件 {event} 及文件匹配 {pat} 加入
新的自动命令
|:autocmd| :au! 清除所有自动命令
|:autocmd| :au! {event} 清除所有事件 {event} 的自动命令
Remove all autocommands for {event}
|:autocmd| :au! * {pat} 清除所有文件匹配 {pat} 的自动命令
|:autocmd| :au! {event} {pat} 清除所有文件匹配 {pat} 及事件 {event} 的自动命令
|:autocmd| :au! {event} {pat} {cmd} 清除所有文件匹配 {pat} 及事件 {event} 的
自动命令并加入新的
------------------------------------------------------------------------------
*Q_wi* 多窗口命令

|CTRL-W_s| CTRL-W s 或 :split 将窗口分割成两部分
|:split_f| :split {file} 分隔窗口并在其中一个编辑 {file}
|:sfind| :sf[ind] {file} 分隔窗口, 从 {path} 中找到文件 {file}
并编辑之
|:vsplit| :vsplit {file} 同上,但垂直分割
|:vertical| :vertical {cmd} 使命令 {cmd} 垂直分割
|CTRL-W_]| CTRL-W ] 分割窗口并跳转至光标下的标签
|CTRL-W_f| CTRL-W f 分隔窗口并编辑光标下的文件
|CTRL-W_^| CTRL-W ^ 分隔窗口并编辑 alternate file
|CTRL-W_n| CTRL-W n 或 :new 创建新空白窗口
|CTRL-W_q| CTRL-W q 或 :q[uit] 退出编辑并关闭窗口
|CTRL-W_c| CTRL-W c 或 :cl[ose] 隐藏当前缓冲区并关闭窗口
|CTRL-W_o| CTRL-W o 或 :on[ly] 使当前窗口成为唯一窗口

|CTRL-W_j| CTRL-W j 跳转至下方窗口
|CTRL-W_k| CTRL-W k 跳转至上方窗口
|CTRL-W_CTRL-W| CTRL-W CTRL-W 移动光标至下方窗口 (折转)
|CTRL-W_W| CTRL-W W 移动光标至上方窗口 (折转)
|CTRL-W_t| CTRL-W t 跳转至顶端窗口
|CTRL-W_b| CTRL-W b 跳转至底端窗口
|CTRL-W_p| CTRL-W p 跳转至上一次激活的窗口

|CTRL-W_r| CTRL-W r 向下旋转窗口
|CTRL-W_R| CTRL-W R 向上旋转窗口
|CTRL-W_x| CTRL-W x 将当前窗口于下一个窗口对调

|CTRL-W_=| CTRL-W = 使所有窗口等高
|CTRL-W_-| CTRL-W - 减少当前窗口高度
|CTRL-W_+| CTRL-W + 增加当前窗口高度
|CTRL-W__| CTRL-W _ 设置当前窗口高度 (缺省: 很高)
------------------------------------------------------------------------------
*Q_bu* 缓冲区列表命令

|:buffers| :buffers 或 :files 列出所有已知的缓冲和文件名

|:ball| :ball 或 :sball 编辑所有的缓冲
|:unhide| :unhide 或 :sunhide 编辑所有载入的缓冲

|:badd| :badd {fname} 加入文件名 {fname} 到列表中
|:bunload| :bunload[!]
从内存中卸载缓冲

|:bdelete| :bdelete[!]
从内存中卸载缓冲
并从列表中
删除

当前窗口内 新窗口内 ~
|:buffer| :
buffer
:
sbuffer
转到参数/缓冲 N
|:bnext| :
bnext
:
sbnext
转到后面的第 N 个参数/缓冲
|:bNext| :
bNext
:
sbNext
转到前面的第 N 个参数/缓冲
|:bprevious| :
bprevious
:
sbprevious
转到前面的第 N 个参数/缓冲
|:bfirst| :bfirst :sbfirst 转到第一个参数/缓冲
|:blast| :blast :sblast 转到最后一个参数/缓冲
|:bmodified| :
bmod
:
sbmod
转到第 N 个被改动了的缓冲
------------------------------------------------------------------------------
*Q_sy* 语法高亮

|:syn-on| :syntax on 开始使用语法加亮
|:syn-off| :syntax off 停止使用语法加亮

|:syn-keyword| :syntax keyword {group-name} {keyword} ..
添加语法关键字项
|:syn-match| :syntax match {group-name} {pattern} ...
加入语法匹配项
|:syn-region| :syntax region {group-name} {pattern} ...
添加语法区域项
|:syn-sync| :syntax sync [ccomment | lines {N} | ...]
设置语法加亮的同步方式
|:syntax| :syntax [list] 列出当前语法项
|:syn-clear| :syntax clear 清除所有语法信息

|:highlight| :highlight clear 清除所有加亮信息
|:highlight| :highlight {group-name} {key}={arg} ..
为语法组 {group-name} 设置加亮

|:filetype| :filetype on 开启文件类型侦测, 不包括
语法高亮
|:filetype| :filetype plugin indent on
开启文件类型侦测, 包括
包括自动缩进及设置
------------------------------------------------------------------------------
*Q_gu* GUI 命令

|:gui| :gui UNIX: 启动 GUI
|:gui| :gui {fname} .. 同上, 并编辑 {fname} ..

|:menu| :menu 列出所有菜单
|:menu| :menu {mpath} 列出 {mpath} 下的所有菜单
|:menu| :menu {mpath} {rhs} 将 {lhs} 加入菜单 {mpath}
|:menu| :menu {pri} {mpath} {rhs}
同上, 并带有优先权 {pri}
|:menu| :menu ToolBar.{name} {rhs}
将 {lhs} 加入工具条
|:tmenu| :tmenu {mpath} {text} 为菜单 {mpath} 加入 tooltip
|:unmenu| :unmenu {mpath} 删除菜单 {mpath}

------------------------------------------------------------------------------
*Q_fo* 折叠

|'foldmethod'| set foldmethod=manual 手动折叠
set foldmethod=indent 按照缩近折叠
set foldmethod=expr 按照表达式 'foldexpr' 折叠
set foldmethod=syntax 按照语法区域折叠
set foldmethod=marker 按照标记 'foldmarkers' 折叠

|zf| zf{motion} 操作符: 手动定义一个折叠
|:fold| :{range}fold 将范围 {range} 包括的行定义为一个折叠
|zd| zd 删除光标下的一个折叠
|zD| zD 删除光标下的所有折叠

|zo| zo 打开光标下的折叠
|zO| zO 打开光标下的所有折叠
|zc| zc 关闭光标下的一个折叠
|zC| zC 关闭光标下的所有折叠

|zm| zm 折起更多: 减少 'foldlevel'
|zM| zM 关闭所有折叠: 置 'foldlevel' 为0
|zr| zr 减少折叠: 增加 'foldlevel'
|zR| zR 打开所有折叠: 置 'foldlevel' 为最大

|zn| zn 什么也不折叠: 重置 'foldenable'
|zN| zN 正常折叠: 置 'foldenable'
|zi| zi 反转 'foldenable'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: