Nvim :help
页面,从 生成 于 源代码,使用 tree-sitter-vimdoc 解析器。
CTRL-H
, <BS>
, 或 <Left>
键) l N l 向右 (也: <Space>
或 <Right>
键) 0 0 到行首字符 (也: <Home>
键) ^ ^ 到行首第一个非空格字符 $ N $ 到下一个 EOL (行尾) 位置 (也: <End>
键) g0 g0 到屏幕行首字符 (当行换行时与 "0" 不同) g^ g^ 到屏幕行首第一个非空格字符 (当行换行时与 "^" 不同) g$ N g$ 到屏幕行尾字符 (当行换行时与 "$" 不同) gm gm 到屏幕行中间 gM 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 次CTRL-P
和 <Up>
) j N j 向下 N 行 (也: CTRL-J
, CTRL-N
, <NL>
, 和 <Down>
) - N - 向上 N 行,在第一个非空格字符上 + N + 向下 N 行,在第一个非空格字符上 (也: CTRL-M
和 <CR>
) _ N _ 向下 N-1 行,在第一个非空格字符上 G N G 转到第 N 行 (默认: 最后一行),在第一个非空格字符上 gg N gg 转到第 N 行 (默认: 第一行),在第一个非空格字符上 N% N % 转到文件中第 N 个百分比的行;必须给出 N,否则为 % 命令 gk N gk 向上 N 个屏幕行 (当行换行时与 "k" 不同) gj N gj 向下 N 个屏幕行 (当行换行时与 "j" 不同){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 转到光标下标识符的全局声明<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{search-command}
下一步{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] 打印跳转列表{tag}
跳转到标签 {tag}
:ta :[count]ta[g][!] 跳转到标签列表中第 [count] 个更新的标签 CTRL-] CTRL-]
跳转到光标下的标签,除非进行了更改 :ts :ts[elect][!] [tag] 列出匹配的标签并选择一个进行跳转 :tjump :tj[ump][!] [tag] 跳转到标签 [tag] 或从列表中选择,当有多个匹配项时 :ltag :lt[ag][!] [tag] 跳转到标签 [tag] 并将匹配的标签添加到位置列表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][!] 跳到最后一个匹配的标签{tag}
打开一个预览窗口以显示标签 {tag}
CTRL-W_} CTRL-W
} 类似于 CTRL-]
,但在预览窗口中显示标签 :pts :pts[elect] 类似于 ":tselect",但在预览窗口中显示标签 :ptjump :ptj[ump] 类似于 ":tjump",但在预览窗口中显示标签 :pclose :pc[lose] 关闭标签预览窗口 CTRL-W_z CTRL-W
z 关闭标签预览窗口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 重新绘制,当前行位于窗口底部<Insert>
) I N I 在行中第一个非空白字符前插入文本(N 次) gI N gI 在第 1 列插入文本(N 次) o N o 在当前行下方打开新行,附加文本(N 次) O N O 在当前行上方打开新行,附加文本(N 次) :startinsert :star[tinsert][!] 开始插入模式,在使用 [!] 时附加 :startreplace :startr[eplace][!] 开始替换模式,在使用 [!] 时位于行尾<Esc>
结束插入模式,返回正常模式 i_CTRL-C CTRL-C
类似于 <Esc>
,但不会使用缩写 i_CTRL-O CTRL-O
{command}
执行 {command}
并返回插入模式<End>
将光标移动到行尾 i_<Home> <Home>
将光标移动到行首CTRL-V
{char}
.. 按字面意思插入字符,或输入十进制字节值 i_<NL> <NL>
或 <CR>
或 CTRL-M
或 CTRL-J
开始新行 i_CTRL-E CTRL-E
插入光标下方的字符 i_CTRL-Y CTRL-Y
插入光标上方的字符<BS>
或 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
删除当前行中的所有缩进,在下一行恢复缩进CTRL-K
{char1}
{char2}
输入二字符组合 i_digraph {char1}
<BS>
{char2}
输入二字符组合(如果 'digraph' 选项已设置)<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>
s) v_J {visual}
J 合并高亮显示的行 gJ N gJ 类似于 "J",但不插入空格 v_gJ {visual}
gJ 类似于 "{visual}J",但不插入空格 :d :[range]d [x] 删除 [range] 行 [到寄存器 x 中]{char}
用于接下来的删除、剪切或粘贴操作 :reg :reg 显示所有寄存器的内容 :reg :reg {arg}
显示 {arg}
中提到的寄存器的内容 y N y{motion} 将使用 {motion}
移动的文本剪切到寄存器中 v_y {visual}
y 将高亮显示的文本剪切到寄存器中 yy N yy 将 N 行剪切到寄存器中 Y N Y 将 N 行剪切到寄存器中 注意: 默认情况下映射到 "y$"。 default-mappings p N p 在光标位置后粘贴一个寄存器(N 次) P N P 在光标位置前粘贴一个寄存器(N 次) ]p N ]p 类似于 p,但将缩进调整到当前行 [p N [p 类似于 P,但将缩进调整到当前行 gp N gp 类似于 p,但将光标留在新文本之后 gP N gP 类似于 P,但将光标留在新文本之后{char}
gr N gr{char} 替换 N 个字符,但不影响布局 R N R 进入替换模式(重复输入的文本 N 次) gR N gR 进入虚拟替换模式:类似于替换模式,但不影响布局 v_b_r {visual}
r{char} 在可视块模式下:将选定文本中的每个字符替换为 {char}
{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 在可视块模式下:将每行选定的文本更改到行尾,用输入的文本更改{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 编码{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] 中的行右对齐{command}
移动的那些行 !! N !!{command}<CR> 过滤 N 行通过 {command}
v_! {visual}
!{command}<CR> 过滤高亮显示的那些行通过 {command}
:range! :[range]! {command}
<CR>
过滤 [range] 行通过 {command}
= N ={motion} 过滤通过 'equalprg' 移动的那些行 == N == 过滤 N 行通过 'equalprg' v_= {visual}
= 过滤高亮显示的那些行通过 'equalprg' :s :[range]s[ubstitute]/{pattern}/{string}/[g][c] 替换 {pattern}
为 {string}
在 [range] 行中;使用 [g] 替换 {pattern}
的所有出现;使用 [c] 确认每次替换 :s :[range]s[ubstitute] [g][c] 使用新的范围和选项重复之前的 ":s" & & 在当前行上重复之前的 ":s" 且不带选项 :ret :[range]ret[ab][!] [tabstop] 将 'tabstop' 设置为新的值并相应地调整空格CTRL-V
开始高亮显示块状 } 高亮显示的文本 v_o o 交换光标位置与高亮显示的开头 gv gv 在之前可视区域上开始高亮显示 v_v v 高亮显示字符或停止高亮显示 v_V V 高亮显示整行或停止高亮显示 v_CTRL-V CTRL-V
高亮显示块状或停止高亮显示[{
到 ]}
) v_iB N iB 选择 "块内部" (从 [{
到 ]}
) v_a> N a> 选择 "一个 <> 块" v_i> N i> 选择 " <> 块内部" v_at N at 选择 "一个标签块" (从 <aaa>
到 </aaa>) v_it N it 选择 "标签块内部" (从 <aaa>
到 </aaa>) v_a' N a' 选择 "一个单引号字符串" v_i' N i' 选择 "单引号字符串内部" v_aquote N a" 选择 "一个双引号字符串" v_iquote N i" 选择 "双引号字符串内部" v_a` N a` 选择 "一个反引号字符串" v_i` N i` 选择 "反引号字符串内部"{a-z}
中 q q{A-Z} 记录输入的字符,追加到寄存器 {a-z}
中 q q 停止记录 Q Q 重播上次记录的宏 @ N @{a-z} 执行寄存器 {a-z}
的内容(N 次) @@ N @@ 重复之前的 @{a-z} (N 次) :@ :@{a-z} 以 Ex 命令的形式执行寄存器 {a-z}
的内容 :@@ :@@ 重复之前的 :@{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 秒{lhs}
{rhs}
在普通模式和可视模式下将 {lhs}
映射到 {rhs}
:map! :ma[p]! {lhs}
{rhs}
在插入模式和命令行模式下将 {lhs}
映射到 {rhs}
: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" 一样,但仅针对操作符等待时 :mapc :mapc[lear] 删除普通模式和可视模式的映射 :mapc :mapc[lear]! 删除插入模式和命令行模式的映射 :imapc :imapc[lear] 删除插入模式的映射 :vmapc :vmapc[lear] 删除可视模式的映射 :omapc :omapc[lear] 删除操作符等待模式的映射 :nmapc :nmapc[lear] 删除普通模式的映射 :cmapc :cmapc[lear] 删除命令行模式的映射 :mkexrc :mk[exrc][!] [file] 将当前映射、缩写和设置写入 [file] (默认: ".exrc";使用 ! 来覆盖) :mkvimrc :mkv[imrc][!] [file] 与 :mkexrc 相同,但默认值为 ".nvimrc" :mksession :mks[ession][!] [file] 与 :mkvimrc 相同,但也会存储当前文件、窗口等,以便以后能够继续此会话{lhs}
{rhs}
为 {lhs}
添加缩写为 {rhs}
:abbreviate :ab[breviate] {lhs}
显示以 {lhs}
开头的缩写 :abbreviate :ab[breviate] 显示所有缩写 :unabbreviate :una[bbreviate] {lhs}
删除 {lhs}
的缩写 :noreabbrev :norea[bbrev] [lhs] [rhs] 像 ":ab" 一样,但不会重新映射 [rhs] :iabbrev :iab/:iunab/:inoreab 像 ":ab" 一样,但仅针对插入模式 :cabbrev :cab/:cunab/:cnoreab 像 ":ab" 一样,但仅针对命令行模式 :abclear :abc[lear] 删除所有缩写 :cabclear :cabc[lear] 删除命令行模式的所有缩写 :iabclear :iabc[lear] 删除插入模式的所有缩写{option}
设置布尔选项(打开它),显示字符串或数字选项 :set :se[t] no{option} 重置布尔选项(关闭它) :set :se[t] inv{option} 反转布尔选项 :set :se[t] {option}
={value} 将字符串/数字选项设置为 {value}
:set :se[t] {option}
+={value} 将 {value}
追加到字符串选项,将 {value}
添加到数字选项 :set :se[t] {option}
-={value} 从字符串选项中删除 {value}
,从数字选项中减去 {value}
:set :se[t] {option}
显示 {option}
的值 :set :se[t] {option}
& 将 {option}
重置为其默认值CTRL-_
in Insert mode 'ambiwidth' 'ambw' what to do with Unicode chars of ambiguous width 'arabic' 'arab' for Arabic as a default second language 'arabicshape' 'arshape' do shaping for Arabic characters 'autochdir' 'acd' change directory to the file in the current window '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 'belloff' 'bo' do not ring the bell for these reasons 'binary' 'bin' read/write/edit file in binary mode 'bomb' prepend a Byte Order Mark to the file 'breakat' 'brk' characters that may cause a line break 'breakindent' 'bri' wrapped line repeats indent 'breakindentopt' 'briopt' settings for 'breakindent' '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 'cdhome' 'cdh' change directory to the home directory by ":cd" '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 'cinscopedecls' 'cinsd' words that are recognized by 'cino-g' '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 'colorcolumn' 'cc' columns to highlight '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 'complete' 'cpt' specify how Insert mode completion works 'completefunc' 'cfu' function to be used for Insert mode completion 'completeopt' 'cot' options for Insert mode completion 'completeslash' 'csl' like 'shellslash' for completion 'concealcursor' 'cocu' whether concealable text is hidden in cursor line 'conceallevel' 'cole' whether concealable text is shown or hidden 'confirm' 'cf' ask what to do about unsaved/read-only files 'copyindent' 'ci' make 'autoindent' use existing indent structure 'cpoptions' 'cpo' flags for Vi-compatible behavior 'cursorbind' 'crb' move cursor in window as it moves in other windows 'cursorcolumn' 'cuc' highlight the screen column of the cursor 'cursorline' 'cul' highlight the screen line of the cursor 'cursorlineopt' 'culopt' settings for 'cursorline' '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 'encoding' 'enc' encoding used internally 'endoffile' 'eof' write CTRL-Z
at end of the file '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 'eventignore' 'ei' autocommand events that are ignored 'expandtab' 'et' use spaces when <Tab>
is inserted 'exrc' 'ex' read init files in the current directory 'fileencoding' 'fenc' file encoding for multibyte text 'fileencodings' 'fencs' automatically detected character encodings 'fileformat' 'ff' file format used for file I/O 'fileformats' 'ffs' automatically detected values for 'fileformat' 'fileignorecase' 'fic' ignore case when using file names 'filetype' 'ft' type of file, used for autocommands 'fillchars' 'fcs' characters to use for displaying special items 'findfunc' 'ffu' function to be called for the :find command 'fixendofline' 'fixeol' make sure last line in file has <EOL>
'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 'formatexpr' 'fex' expression used with "gq" command 'formatlistpat' 'flp' pattern used to recognize a list header 'formatoptions' 'fo' how automatic formatting is to be done 'formatprg' 'fp' name of external program used with "gq" command 'fsync' 'fs' whether to invoke fsync() after file write '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 'guifontwide' 'gfw' list of font names for double-wide characters 'guioptions' 'go' GUI: Which components and options are used 'guitablabel' 'gtl' GUI: custom label for a tab page 'guitabtooltip' 'gtt' GUI: custom tooltip for a tab page '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 abandoned 'history' 'hi' number of command-lines that are remembered 'hlsearch' 'hls' highlight matches with last search pattern '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 '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 '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 'jumpoptions' 'jop' specifies how jumping is done '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 'langremap' 'lrm' do apply 'langmap' to mapped characters '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 'lispoptions' 'lop' changes how Lisp indenting is done '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" 'makeencoding' 'menc' encoding of external make/grep commands '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 'maxcombine' 'mco' maximum nr of combining characters displayed 'maxfuncdepth' 'mfd' maximum recursive depth for user functions 'maxmapdepth' 'mmd' maximum recursive depth for mapping 'maxmempattern' 'mmp' maximum memory (in Kbyte) used for pattern search 'menuitems' 'mis' maximum number of items in a menu 'mkspellmem' 'msm' memory used before :mkspell compresses the tree 'modeline' 'ml' recognize modelines at start or end of file 'modelineexpr' 'mle' allow setting expression options from a modeline '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 'mousemoveevent' 'mousemev' report mouse moves with <MouseMove>
'mousescroll' amount to scroll by when scrolling with a mouse '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 'numberwidth' 'nuw' number of columns used for the line number 'omnifunc' 'ofu' function for filetype-specific completion 'opendevice' 'odev' allow reading/writing devices on MS-Windows 'operatorfunc' 'opfunc' function to be called for g@ operator 'packpath' 'pp' list of directories used for packages 'paragraphs' 'para' nroff macros that separate paragraphs '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 'pumheight' 'ph' maximum number of items to show in the popup menu 'pumwidth' 'pw' minimum width of the popup menu 'pyxversion' 'pyx' Python version used for pyx* commands 'quoteescape' 'qe' escape characters used in a string 'readonly' 'ro' disallow writing the buffer 'redrawtime' 'rdt' timeout for 'hlsearch' and :match highlighting 'regexpengine' 're' default regexp engine to use 'relativenumber' 'rnu' show relative line number in front of each line 'report' threshold for reporting nr. of lines changed '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 'shada' 'sd' use .shada file upon startup and exiting '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 'shelltemp' 'stmp' whether to use a temp file for shell commands 'shellxescape' 'sxe' characters to escape when 'shellxquote' is ( '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 'showbreak' 'sbr' string to use at the start of wrapped lines 'showcmd' 'sc' show (partial) command somewhere 'showcmdloc' 'sloc' where to show (partial) command '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 'showtabline' 'stal' tells when the tab pages line is displayed 'sidescroll' 'ss' minimum number of columns to scroll horizontal 'sidescrolloff' 'siso' min. nr. of columns to left and right of cursor 'signcolumn' 'scl' when and how to display the sign column 'smartcase' 'scs' no ignore case when pattern has uppercase 'smartindent' 'si' smart autoindenting for C programs 'smarttab' 'sta' use 'shiftwidth' when inserting <Tab>
'smoothscroll' 'sms' scroll by screen lines when 'wrap' is set 'softtabstop' 'sts' number of spaces that <Tab>
uses while editing 'spell' enable spell checking 'spellcapcheck' 'spc' pattern to locate end of a sentence 'spellfile' 'spf' files where zg and zw store words 'spelllang' 'spl' language(s) to do spell checking for 'spelloptions' 'spo' options for spell checking 'spellsuggest' 'sps' method(s) used to suggest spelling corrections 'splitbelow' 'sb' new window from split is below the current one 'splitkeep' 'spk' determines scroll behavior for split windows 'splitright' 'spr' new window is put right of the current one 'startofline' 'sol' commands move cursor to first non-blank in line 'statuscolumn' 'stc' custom format for the status column '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 'switchbuf' 'swb' sets behavior when switching to another buffer 'synmaxcol' 'smc' maximum column to find syntax items 'syntax' 'syn' syntax to be loaded for current buffer 'tabclose' 'tcl' which tab page to focus when closing a tab 'tabline' 'tal' custom format for the console tab pages line 'tabpagemax' 'tpm' maximum number of tab pages for -p and "tab all" 'tabstop' 'ts' number of spaces that <Tab>
in file uses 'tagbsearch' 'tbs' use binary searching in tags files 'tagcase' 'tc' how to handle case when searching in tags files 'tagfunc' 'tfu' function to get list of tag matches '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 'termguicolors' 'tgc' enable 24-bit RGB color in the TUI 'textwidth' 'tw' maximum width of text that is being inserted 'thesaurus' 'tsr' list of thesaurus files for keyword completion 'thesaurusfunc' 'tsrfu' function to be used for thesaurus 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 'ttimeout' time out on mappings 'ttimeoutlen' 'ttm' time out time for key codes in milliseconds 'ttytype' 'tty' alias for 'term' 'undodir' 'udir' where to store undo files 'undofile' 'udf' save undo information in a file 'undolevels' 'ul' maximum number of changes that can be undone 'undoreload' 'ur' max nr of lines to save for undo on a buffer reload 'updatecount' 'uc' after this many characters flush swap file 'updatetime' 'ut' after this many milliseconds flush swap file 'varsofttabstop' 'vsts' a list of number of spaces when typing <Tab>
'vartabstop' 'vts' a list of number of spaces for <Tab>
s 'verbose' 'vbs' give informative messages 'verbosefile' 'vfile' file to write messages in 'viewdir' 'vdir' directory where to store files with :mkview 'viewoptions' 'vop' specifies what to save for :mkview 'virtualedit' 've' when to use virtual editing 'visualbell' 'vb' use visual bell instead of beeping 'warn' warn for shell command when buffer was changed '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 'wildignorecase' 'wic' ignore case when completing file names 'wildmenu' 'wmnu' use menu for command line completion 'wildmode' 'wim' mode for 'wildchar' command-line expansion 'wildoptions' 'wop' specifies how command line completion is done 'winaltkeys' 'wak' when the windows system handles ALT keys 'window' 'wi' nr of lines to scroll for CTRL-F
and CTRL-B
'winfixbuf' 'wfb' keep window focused on a single buffer 'winfixheight' 'wfh' keep window height when opening/closing windows 'winfixwidth' 'wfw' keep window width when opening/closing windows 'winheight' 'wh' minimum number of lines for the current window 'winhighlight' 'winhl' window-local highlighting '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)CTRL-L
清理并重绘屏幕 CTRL-G CTRL-G
显示当前文件名(带路径)和光标位置 ga ga 以十进制、十六进制和八进制显示光标下字符的 ASCII 值 g8 g8 对于 utf-8 编码:以十六进制显示光标下字符的字节序列 g_CTRL-G g CTRL-G
显示光标列、行和字符位置 CTRL-C CTRL-C
在搜索期间:中断搜索 <Del> <Del>
在输入计数时:删除最后一个字符 :version :ve[rsion] 显示版本信息 :normal :norm[al][!] {commands}
执行普通模式命令 gQ gQ 切换到 "Ex" 模式{file}
将重定向消息重定向到 {file}
:silent :silent[!] {command}
静默执行 {command}
:confirm :confirm {command}
退出、写入等,询问未保存的更改或只读文件 :browse :browse {command}
使用文件选择对话框打开/读取/写入文件CTRL-V
{char}
按字面插入 {char}
c_CTRL-V CTRL-V
{number}
输入字符的十进制值(最多三位数) c_CTRL-K CTRL-K
{char1}
{char2}
输入双字符(参见 Q_di) c_CTRL-R CTRL-R
{register}
插入寄存器的内容<Left>
/<Right> 光标左/右 c_<S-Left> <S-Left>
/<S-Right> 光标向左/右移动一个单词 c_CTRL-B CTRL-B
/CTRL-E 光标移动到命令行的开头/结尾<Up>
/<Down> 回调以当前命令开头的较旧/较新的命令行 c_<S-Up> <S-Up>
/<S-Down> 从历史记录中回调较旧/较新的命令行 c_CTRL-G CTRL-G
当 'incsearch' 处于活动状态时,下一个匹配项 c_CTRL-T CTRL-T
当 'incsearch' 处于活动状态时,上一个匹配项 :history :his[tory] 显示较旧的命令行<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' 具有多个匹配项后:转到上一个匹配项{number}
一个绝对行号 :range . 当前行 :range $ 文件中的最后一行 :range % 等于 1,$(整个文件) :range * 等于 '<,'>(视觉区域) :range 't 标记 t 的位置 :range /{pattern}[/] {pattern}
匹配的下一行 :range ?{pattern}[?] {pattern}
匹配的上一行<abuf>
缓冲区编号,用于自动命令(仅在需要文件名的地方) :<afile> <afile>
文件名,用于自动命令(仅在需要文件名的地方) :<amatch> <amatch>
与模式匹配的内容,用于自动命令(仅在需要文件名的地方) :<cword> <cword>
光标下的单词(仅在需要文件名的地方) :<cWORD> <cWORD>
光标下的 WORD(仅在需要文件名的地方)(参见 WORD) :<cfile> <cfile>
光标下的文件名(仅在需要文件名的地方) :<sfile> <sfile>
":source" 的文件的名称,在该文件内(仅在需要文件名的地方){pat}
替换为 {repl}
{file}
.. 开始编辑一个或多个文件 -- vim [options] - 从 stdin 读取文件 -tag vim [options] -t {tag}
编辑与 {tag}
关联的文件 -qf vim [options] -q [fname] 在快速修复模式下开始编辑,显示第一个错误{command}
-+/ +/{pat} {file}
.. 将光标置于 {pat}
的第一个出现位置 -e -e Ex 模式,在 Ex 模式下启动 vim -R -R 只读模式,意味着 -n -m -m 不允许修改(重置 'write' 选项) -d -d diff-mode -b -b 二进制模式 -l -l lisp 模式 -A -A 阿拉伯语模式('arabic' 已设置) -H -H 希伯来语模式(希伯来语键映射和 'rightleft' 已设置) -V -V 详细,给出信息性消息 -r -r 给出交换文件列表 -r -r {file}
.. 恢复中止的编辑会话 -n -n 不要创建交换文件 -o -o [num] 打开 [num] 个窗口(默认:每个文件一个) -s -s {scriptin}
首先从文件 {scriptin}
中读取命令 -w -w {scriptout}
将键入的字符写入文件 {scriptout}
(追加) -W -W {scriptout}
将键入的字符写入文件 {scriptout}
(覆盖) -u -u {vimrc}
从 {vimrc}
中读取初始化,而不是其他初始化 -i -i {shada}
从 {shada}
中读取信息,而不是其他文件 --- -- 选项的结束,其他参数是文件名 --help --help 显示参数列表并退出 --version --version 显示版本信息并退出 -- - 从 stdin 读取文件{file}
编辑 {file}
:edit :e[dit][!] 重新加载当前文件 :enew :ene[w][!] 编辑一个新的未命名缓冲区 :find :fin[d][!] {file}
在 'path' 中查找 {file}
并编辑它CTRL-^
编辑备用文件 N(相当于 ":e #N") gf gf 或 ]f 编辑光标下方的文件名 :pwd :pwd 打印当前目录名 :cd :cd [path] 将当前目录更改为 [path] :cd- :cd - 返回到上一个当前目录 :file :f[ile] 打印当前文件名和光标位置 :file :f[ile] {name}
将当前文件名设置为 {name}
:files :files 显示备用文件名{file}
写入 {file}
并编辑下一个文件,除非 {file}
存在;带 !,覆盖现有文件 :wN :wN[ext][!] [file] 写入文件并编辑上一个文件{arglist}
:sn[ext] {arglist}
定义新的参数列表并编辑第一个文件 :Next :N[ext] :sN[ext] 编辑上一个文件 :first :fir[st] :sfir[st] 编辑第一个文件 :last :la[st] :sla[st] 编辑最后一个文件{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} 使用 [range] 行作为标准输入执行 {cmd}
:up :[range]up[date][!] 如果已修改,则写入当前文件 :wall :wa[ll][!] 写入所有已更改的缓冲区{file}
保存到 {file}
并退出 :xit :x[it][!] [file] 与“:wq”类似,但在有修改时才保存 ZZ ZZ 与“:x”相同 ZQ ZQ 与“:q!”相同 :xall :xa[ll][!] 或 :wqall[!] 保存所有修改过的缓冲区并退出{event}
列出 {event}
的所有自动命令 :autocmd :au {event}
{pat}
列出 {event}
的所有自动命令,带有 {pat}
:autocmd :au {event}
{pat}
{cmd}
为 {event}
添加新的自动命令,带有 {pat}
:autocmd :au! 删除所有自动命令 :autocmd :au! {event}
删除 {event}
的所有自动命令 :autocmd :au! * {pat}
删除 {pat}
的所有自动命令 :autocmd :au! {event}
{pat}
删除 {event}
的所有自动命令,带有 {pat}
:autocmd :au! {event}
{pat}
{cmd}
删除 {event}
的所有自动命令,带有 {pat}
并添加新的命令CTRL-W
s 或 :split 将窗口分成两部分 :split_f :split {file}
分割窗口并在其中一个窗口中编辑 {file}
:vsplit :vsplit {file}
相同,但垂直分割 :vertical :vertical {cmd}
使 {cmd}
垂直分割{file}
分割窗口,在 'path' 中查找 {file}
并编辑它 :terminal :terminal {cmd}
打开一个终端窗口 CTRL-W_] CTRL-W
] 分割窗口并跳转到光标下的标签 CTRL-W_f CTRL-W
f 分割窗口并编辑光标下的文件名 CTRL-W_^ CTRL-W
^ 分割窗口并编辑备用文件 CTRL-W_n CTRL-W
n 或 :new 创建新的空白窗口 CTRL-W_q CTRL-W
q 或 :q[uit] 退出编辑并关闭窗口 CTRL-W_c CTRL-W
c 或 :clo[se] 将缓冲区隐藏并关闭窗口 CTRL-W_o CTRL-W
o 或 :on[ly] 将当前窗口设置为屏幕上唯一的窗口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
= 使所有窗口的高度和宽度相等 CTRL-W_- CTRL-W
- 降低当前窗口的高度 CTRL-W_+ CTRL-W
+ 提高当前窗口的高度 CTRL-W__ CTRL-W
_ 设置当前窗口的高度(默认:非常高){fname}
将文件名 {fname}
添加到列表 :bunload :bunload[!] [N] 从内存中卸载缓冲区 [N] :bdelete :bdelete[!] [N] 卸载缓冲区 [N] 并将其从缓冲区列表中删除{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 清除所有语法信息{group-name}
{key}
={arg} .. 设置 {group-name}
的高亮{mpath}
列出以 {mpath}
开头的菜单 :menu :menu {mpath}
{rhs}
添加菜单 {mpath}
,给出 {rhs}
:menu :menu {pri}
{mpath}
{rhs}
同上,带有优先级 {pri}
:menu :menu ToolBar.{name} {rhs}
添加工具栏项,给出 {rhs}
:tmenu :tmenu {mpath}
{text}
为菜单 {mpath}
添加工具提示 :unmenu :unmenu {mpath}
删除菜单 {mpath}