索引

Nvim 的 :help 页面,从 生成源代码, 使用 tree-sitter-vimdoc 解析器。


此文件包含每个模式的所有命令列表,并附带标签和简短描述。列表按 ASCII 值排序。
提示:查找特定功能时,请使用搜索命令。例如,要查找删除某些内容,请使用:"/delete"。
有关选项的概述,请参阅 option-list。有关内置函数的概述,请参阅 functions。有关 Vim 变量列表,请参阅 vim-variable

1. 插入模式 insert-index

标签 字符 在插入模式下的操作
------------------------------------------------------------------------------
i_CTRL-@ CTRL-@ 插入之前插入的文本并停止插入 i_CTRL-A CTRL-A 插入之前插入的文本 i_CTRL-C CTRL-C 退出插入模式,不检查缩写 i_CTRL-D CTRL-D 删除当前行中的一个缩进宽度 i_CTRL-E CTRL-E 插入光标下方的字符 CTRL-F 未使用(但默认情况下在 'cinkeys' 中重新缩进当前行) i_CTRL-G_j CTRL-G CTRL-J 行向下,到插入开始处的列 i_CTRL-G_j CTRL-G j 行向下,到插入开始处的列 i_CTRL-G_j CTRL-G <Down> 行向下,到插入开始处的列 i_CTRL-G_k CTRL-G CTRL-K 行向上,到插入开始处的列 i_CTRL-G_k CTRL-G k 行向上,到插入开始处的列 i_CTRL-G_k CTRL-G <Up> 行向上,到插入开始处的列 i_CTRL-G_u CTRL-G u 开始新的可撤销编辑 i_CTRL-G_U CTRL-G U 不要用下一个光标移动来中断撤销 i_<BS> <BS> 删除光标前的字符 i_digraph {char1}<BS>{char2} 输入二字符组合 (仅当 'digraph' 选项设置时) i_CTRL-H CTRL-H<BS> 相同 i_<Tab> <Tab> 插入一个 <Tab> 字符 i_CTRL-I CTRL-I<Tab> 相同 i_<NL> <NL><CR> 相同 i_CTRL-J CTRL-J<CR> 相同 i_CTRL-K CTRL-K {char1} {char2} 输入二字符组合 i_<CR> <CR> 开始新行 i_CTRL-M CTRL-M<CR> 相同 i_CTRL-N CTRL-N 查找光标前面的关键字的下一个匹配项 i_CTRL-O CTRL-O 执行单个命令并返回插入模式 i_CTRL-P CTRL-P 查找光标前面的关键字的上一个匹配项 i_CTRL-Q CTRL-QCTRL-V 相同,除非用于终端控制流 i_CTRL-SHIFT-Q CTRL-SHIFT-Q {char}CTRL-Q 一样,除非 tui-modifyOtherKeys 处于活动状态 i_CTRL-R CTRL-R {register} 插入寄存器的内容 i_CTRL-R_CTRL-R CTRL-R CTRL-R {register} 插入寄存器的内容,按字面意义 i_CTRL-R_CTRL-O CTRL-R CTRL-O {register} 按字面意义插入寄存器的内容,并且不自动缩进 i_CTRL-R_CTRL-P CTRL-R CTRL-P {register} 按字面意义插入寄存器的内容,并修复缩进。 CTRL-S 未使用或用于终端控制流 i_CTRL-T CTRL-T 在当前行中插入一个缩进宽度 i_CTRL-U CTRL-U 删除当前行中所有输入的字符 i_CTRL-V CTRL-V {char} 按字面意义插入下一个非数字字符 i_CTRL-SHIFT-V CTRL-SHIFT-V {char}CTRL-V 一样,除非 tui-modifyOtherKeys 处于活动状态 i_CTRL-V_digit CTRL-V {number} 插入三位十进制数作为单个字节。 i_CTRL-W CTRL-W 删除光标前的单词 i_CTRL-X CTRL-X {mode} 进入 CTRL-X 子模式,请参阅 i_CTRL-X_index i_CTRL-Y CTRL-Y 插入光标上方的字符 i_<Esc> <Esc> 结束插入模式 i_CTRL-[ CTRL-[<Esc> 相同 i_CTRL-\_CTRL-N CTRL-\ CTRL-N 转到普通模式 i_CTRL-\_CTRL-G CTRL-\ CTRL-G 转到普通模式 CTRL-\ a - z 为扩展保留 CTRL-\ 其他未使用 i_CTRL-] CTRL-] 触发缩写 i_CTRL-^ CTRL-^ 切换 :lmap 映射的使用 i_CTRL-_ CTRL-_'allowrevins' 设置时:切换 'revins'
<Space> 到 '~' 未使用,除了 '0' 和 '^' 后面跟着 CTRL-D
i_0_CTRL-D 0 CTRL-D 删除当前行中的所有缩进 i_^_CTRL-D ^ CTRL-D 删除当前行中的所有缩进,并在下一行中恢复它
i_<Del> <Del> 删除光标下的字符
元字符 (0x80 到 0xff,128 到 255) 未使用
i_<Left> <Left> 光标左移一个字符 i_<S-Left> <S-Left> 光标左移一个单词 i_<C-Left> <C-Left> 光标左移一个单词 i_<Right> <Right> 光标右移一个字符 i_<S-Right> <S-Right> 光标右移一个单词 i_<C-Right> <C-Right> 光标右移一个单词 i_<Up> <Up> 光标上移一行 i_<S-Up> <S-Up><PageUp> 相同 i_<Down> <Down> 光标下移一行 i_<S-Down> <S-Down><PageDown> 相同 i_<Home> <Home> 光标移至行首 i_<C-Home> <C-Home> 光标移至文件开头 i_<End> <End> 光标移至行尾 i_<C-End> <C-End> 光标移至文件末尾 i_<PageUp> <PageUp> 向上滚动一屏 i_<PageDown> <PageDown> 向下滚动一屏 i_<F1> <F1><Help> 相同 i_<Help> <Help> 停止插入模式并显示帮助窗口 i_<Insert> <Insert> 切换插入/替换模式 i_<LeftMouse> <LeftMouse> 光标移至鼠标单击的位置 i_<ScrollWheelDown> <ScrollWheelDown> 将窗口向下移动三行 i_<S-ScrollWheelDown> <S-ScrollWheelDown> 将窗口向下移动一页 i_<ScrollWheelUp> <ScrollWheelUp> 将窗口向上移动三行 i_<S-ScrollWheelUp> <S-ScrollWheelUp> 将窗口向上移动一页 i_<ScrollWheelLeft> <ScrollWheelLeft> 将窗口向左移动六列 i_<S-ScrollWheelLeft> <S-ScrollWheelLeft> 将窗口向左移动一页 i_<ScrollWheelRight> <ScrollWheelRight> 将窗口向右移动六列 i_<S-ScrollWheelRight> <S-ScrollWheelRight> 将窗口向右移动一页
CTRL-X 子模式中的命令 i_CTRL-X_index
i_CTRL-X_CTRL-D CTRL-X CTRL-D 完成定义的标识符 i_CTRL-X_CTRL-E CTRL-X CTRL-E 向上滚动 i_CTRL-X_CTRL-F CTRL-X CTRL-F 完成文件名 i_CTRL-X_CTRL-I CTRL-X CTRL-I 完成标识符 i_CTRL-X_CTRL-K CTRL-X CTRL-K 从字典中完成标识符 i_CTRL-X_CTRL-L CTRL-X CTRL-L 完成整行 i_CTRL-X_CTRL-N CTRL-X CTRL-N 下一个完成 i_CTRL-X_CTRL-O CTRL-X CTRL-O 全能完成 i_CTRL-X_CTRL-P CTRL-X CTRL-P 上一个完成 i_CTRL-X_CTRL-S CTRL-X CTRL-S 拼写建议 i_CTRL-X_CTRL-T CTRL-X CTRL-T 从同义词典中完成标识符 i_CTRL-X_CTRL-Y CTRL-X CTRL-Y 向下滚动 i_CTRL-X_CTRL-U CTRL-X CTRL-U 使用 'completefunc' 完成 i_CTRL-X_CTRL-V CTRL-X CTRL-V 像在 : 命令行中一样完成 i_CTRL-X_CTRL-Z CTRL-X CTRL-Z 停止完成,保持文本原样 i_CTRL-X_CTRL-] CTRL-X CTRL-] 完成标签 i_CTRL-X_s CTRL-X s 拼写建议
完成模式中的命令 (请参阅 popupmenu-keys)
complete_CTRL-E CTRL-E 停止完成并返回原始文本 complete_CTRL-Y CTRL-Y 接受选定的匹配项并停止完成 CTRL-L 从当前匹配项中插入一个字符 <CR> 插入当前选定的匹配项 <BS> 删除一个字符并重新搜索 CTRL-H<BS> 相同 <Up> 选择上一个匹配项 <Down> 选择下一个匹配项 <PageUp> 选择几个条目前的匹配项 <PageDown> 选择几个条目后的匹配项 其他 停止完成并插入输入的字符

2. 普通模式 normal-index

CHAR 任何非空白字符 WORD 非空白字符序列 N 在命令前输入的数字 {motion} 光标移动命令 Nmove 使用 {motion} 移动的文本 SECTION 一个部分,可能以 '}' 而不是 '{' 开头
注意:1 = 光标移动命令;2 = 可以撤销/重做
标签 字符 注意 在普通模式下的操作
------------------------------------------------------------------------------
CTRL-@ 未使用 CTRL-A CTRL-A 2 在光标位置/之后添加 N 到数字 CTRL-B CTRL-B 1 向后滚动 N 个屏幕 CTRL-C CTRL-C 中断当前(搜索)命令 CTRL-D CTRL-D 向下滚动 N 行(默认:半个屏幕) CTRL-E CTRL-E 向上滚动 N 行(N 行额外) CTRL-F CTRL-F 1 向前滚动 N 个屏幕 CTRL-G CTRL-G 显示当前文件名和位置 <BS> <BS> 1 与 "h" 相同 CTRL-H CTRL-H 1 与 "h" 相同 <Tab> <Tab> 1 转到跳转列表中 N 个较新的条目 CTRL-I CTRL-I 1 与 <Tab> 相同 <NL> <NL> 1 与 "j" 相同 <S-NL> <S-NL> 1 与 CTRL-F 相同 CTRL-J CTRL-J 1 与 "j" 相同 CTRL-K 未使用 CTRL-L CTRL-L 重新绘制屏幕 <CR> <CR> 1 光标移到低 N 行的第一个字符 <S-CR> <S-CR> 1 与 CTRL-F 相同 CTRL-M CTRL-M 1 与 <CR> 相同 CTRL-N CTRL-N 1 与 "j" 相同 CTRL-O CTRL-O 1 转到跳转列表中 N 个较旧的条目 CTRL-P CTRL-P 1 与 "k" 相同 CTRL-Q 未使用,或用于终端控制流 CTRL-R CTRL-R 2 重做使用 'u' 撤消的更改 CTRL-S 未使用,或用于终端控制流 CTRL-T CTRL-T 跳转到标记列表中 N 个较旧的标记 CTRL-U CTRL-U 向上滚动 N 行(默认:半个屏幕) CTRL-V CTRL-V 启动块状可视模式 CTRL-W CTRL-W {char} 窗口命令,请参阅 CTRL-W CTRL-X CTRL-X 2 从光标位置/之后数字中减去 N CTRL-Y CTRL-Y 向下滚动 N 行 CTRL-Z CTRL-Z 挂起程序(或启动新的 shell) CTRL-[ <Esc> 未使用 CTRL-\_CTRL-N CTRL-\ CTRL-N 转到正常模式(无操作) CTRL-\_CTRL-G CTRL-\ CTRL-G 转到正常模式(无操作) CTRL-\ a - z 保留供扩展使用 CTRL-\ 其他的未使用 CTRL-] CTRL-] :ta 到光标下的标识符 CTRL-^ CTRL-^ 编辑第 N 个备用文件(等效于 ":e #N") CTRL-<Tab> CTRL-<Tab> 与 g<Tab> 相同:转到上次访问的标签页 CTRL-_ 未使用
<Space> <Space> 1 same as "l" ! !{motion}{filter} 2 filter Nmove text through the {filter} command !! !!{filter} 2 filter N lines through the {filter} command quote "{register} use {register} for next delete, yank or put ({.%#:} only work with put) # # 1 search backward for the Nth occurrence of the ident under the cursor $ $ 1 cursor to the end of Nth next line % % 1 find the next (curly/square) bracket on this line and go to its match, or go to matching comment bracket, or go to matching preprocessor directive. N% {count}% 1 go to N percentage in the file & & 2 repeat last :s ' '{a-zA-Z0-9} 1 cursor to the first CHAR on the line with mark {a-zA-Z0-9} '' '' 1 cursor to the first CHAR of the line where the cursor was before the latest jump. '( '( 1 cursor to the first CHAR on the line of the start of the current sentence ') ') 1 cursor to the first CHAR on the line of the end of the current sentence '< '< 1 cursor to the first CHAR of the line where highlighted area starts/started in the current buffer. '> '> 1 cursor to the first CHAR of the line where highlighted area ends/ended in the current buffer. '[ '[ 1 cursor to the first CHAR on the line of the start of last operated text or start of put text '] '] 1 cursor to the first CHAR on the line of the end of last operated text or end of put text '{ '{ 1 cursor to the first CHAR on the line of the start of the current paragraph '} '} 1 cursor to the first CHAR on the line of the end of the current paragraph ( ( 1 cursor N sentences backward ) ) 1 cursor N sentences forward star * 1 search forward for the Nth occurrence of the ident under the cursor + + 1 same as <CR> <S-Plus> <S-+> 1 same as CTRL-F , , 1 repeat latest f, t, F or T in opposite direction N times - - 1 cursor to the first CHAR N lines higher <S-Minus> <S--> 1 same as CTRL-B . . 2 repeat last change with count replaced with N / /{pattern}<CR> 1 search forward for the Nth occurrence of {pattern} /<CR> /<CR> 1 search forward for {pattern} of last search 0 0 1 cursor to the first char of the line count 1 prepend to command to give a count count 2 " count 3 " count 4 " count 5 " count 6 " count 7 " count 8 " count 9 " : : 1 start entering an Ex command N: {count}: start entering an Ex command with range from current line to N-1 lines down ; ; 1 repeat latest f, t, F or T N times < <{motion} 2 shift Nmove lines one 'shiftwidth' leftwards << << 2 shift N lines one 'shiftwidth' leftwards = ={motion} 2 filter Nmove lines through "indent" == == 2 filter N lines through "indent" > >{motion} 2 shift Nmove lines one 'shiftwidth' rightwards >> >> 2 shift N lines one 'shiftwidth' rightwards ? ?{pattern}<CR> 1 search backward for the Nth previous occurrence of {pattern} ?<CR> ?<CR> 1 search backward for {pattern} of last search @ @{a-z} 2 execute the contents of register {a-z} N times @: @: repeat the previous ":" command N times @@ @@ 2 repeat the previous @{a-z} N times A A 2 append text after the end of the line N times B B 1 cursor N WORDS backward C ["x]C 2 change from the cursor position to the end of the line, and N-1 more lines [into register x]; synonym for "c$" D ["x]D 2 delete the characters under the cursor until the end of the line and N-1 more lines [into register x]; synonym for "d$" E E 1 cursor forward to the end of WORD N F F{char} 1 cursor to the Nth occurrence of {char} to the left G G 1 cursor to line N, default last line H H 1 cursor to line N from top of screen I I 2 insert text before the first CHAR on the line N times J J 2 Join N lines; default is 2 K K lookup Keyword under the cursor with 'keywordprg' L L 1 cursor to line N from bottom of screen M M 1 cursor to middle line of screen N N 1 repeat the latest '/' or '?' N times in opposite direction O O 2 begin a new line above the cursor and insert text, repeat N times P ["x]P 2 put the text [from register x] before the cursor N times R R 2 enter replace mode: overtype existing characters, repeat the entered text N-1 times S ["x]S 2 delete N lines [into register x] and start insert; synonym for "cc". T T{char} 1 cursor till after Nth occurrence of {char} to the left U U 2 undo all latest changes on one line V V start linewise Visual mode W W 1 cursor N WORDS forward X ["x]X 2 delete N characters before the cursor [into register x] Y ["x]Y yank N lines [into register x]; synonym for "yy" Note: Mapped to "y$" by default. default-mappings ZZ ZZ write if buffer changed and close window ZQ ZQ close window without writing [ [{char} square bracket command (see [ below) \ not used ] ]{char} square bracket command (see ] below) ^ ^ 1 cursor to the first CHAR of the line _ _ 1 cursor to the first CHAR N - 1 lines lower ` {a-zA-Z0-9} 1 cursor to the mark {a-zA-Z0-9} `( ( 1 cursor to the start of the current sentence `) ) 1 cursor to the end of the current sentence `< < 1 cursor to the start of the highlighted area `> > 1 cursor to the end of the highlighted area `[ [ 1 cursor to the start of last operated text or start of putted text `] ] 1 cursor to the end of last operated text or end of putted text `` "``" 1 cursor to the position before latest jump `{ { 1 cursor to the start of the current paragraph `} } 1 cursor to the end of the current paragraph a a 2 append text after the cursor N times b b 1 cursor N words backward c ["x]c{motion} 2 delete Nmove text [into register x] and start insert cc ["x]cc 2 delete N lines [into register x] and start insert d ["x]d{motion} 2 delete Nmove text [into register x] dd ["x]dd 2 delete N lines [into register x] do do 2 same as ":diffget" dp dp 2 same as ":diffput" e e 1 cursor forward to the end of word N f f{char} 1 cursor to Nth occurrence of {char} to the right g g{char} extended commands, see g below h h 1 cursor N chars to the left i i 2 insert text before the cursor N times j j 1 cursor N lines downward k k 1 cursor N lines upward l l 1 cursor N chars to the right m m{A-Za-z} set mark {A-Za-z} at cursor position n n 1 repeat the latest '/' or '?' N times o o 2 begin a new line below the cursor and insert text, repeat N times p ["x]p 2 put the text [from register x] after the cursor N times q q{0-9a-zA-Z"} record typed characters into named register {0-9a-zA-Z"} (uppercase to append) q q (while recording) stops recording Q Q 2 replay last recorded register q: q: edit : command-line in command-line window q/ q/ edit / command-line in command-line window q? q? edit ? command-line in command-line window r r{char} 2 replace N chars with {char} s ["x]s 2 (substitute) delete N characters [into register x] and start insert t t{char} 1 cursor till before Nth occurrence of {char} to the right u u 2 undo changes v v start charwise Visual mode w w 1 cursor N words forward x ["x]x 2 delete N characters under and after the cursor [into register x] y ["x]y{motion} yank Nmove text [into register x] yy ["x]yy yank N lines [into register x] z z{char} commands starting with 'z', see z below { { 1 cursor N paragraphs backward bar | 1 cursor to column N } } 1 cursor N paragraphs forward ~ ~ 2 'tildeop' off: switch case of N characters under cursor and move the cursor N characters to the right ~ ~{motion} 'tildeop' on: switch case of Nmove text <C-End> <C-End> 1 same as "G" <C-Home> <C-Home> 1 same as "gg" <C-Left> <C-Left> 1 same as "b" <C-LeftMouse> <C-LeftMouse> ":ta" to the keyword at the mouse click <C-Right> <C-Right> 1 same as "w" <C-RightMouse> <C-RightMouse> same as "CTRL-T" <C-Tab> <C-Tab> same as "g<Tab>" <Del> ["x]<Del> 2 same as "x" N<Del> {count}<Del> remove the last digit from {count} <Down> <Down> 1 same as "j" <End> <End> 1 same as "$" <F1> <F1> same as <Help> <Help> <Help> open a help window <Home> <Home> 1 same as "0" <Insert> <Insert> 2 same as "i" <Left> <Left> 1 same as "h" <LeftMouse> <LeftMouse> 1 move cursor to the mouse click position <MiddleMouse> <MiddleMouse> 2 same as "gP" at the mouse click position <PageDown> <PageDown> same as CTRL-F <PageUp> <PageUp> same as CTRL-B <Right> <Right> 1 same as "l" <RightMouse> <RightMouse> start Visual mode, move cursor to the mouse click position <S-Down> <S-Down> 1 same as CTRL-F <S-Left> <S-Left> 1 same as "b" <S-LeftMouse> <S-LeftMouse> same as "*" at the mouse click position <S-Right> <S-Right> 1 same as "w" <S-RightMouse> <S-RightMouse> same as "#" at the mouse click position <S-Up> <S-Up> 1 same as CTRL-B <Undo> <Undo> 2 same as "u" <Up> <Up> 1 same as "k" <ScrollWheelDown> <ScrollWheelDown> move window three lines down <S-ScrollWheelDown> <S-ScrollWheelDown> move window one page down <ScrollWheelUp> <ScrollWheelUp> move window three lines up <S-ScrollWheelUp> <S-ScrollWheelUp> move window one page up <ScrollWheelLeft> <ScrollWheelLeft> move window six columns left <S-ScrollWheelLeft> <S-ScrollWheelLeft> move window one page left <ScrollWheelRight> <ScrollWheelRight> move window six columns right <S-ScrollWheelRight> <S-ScrollWheelRight> move window one page right

2.1 文本对象 对象

这些可以在操作符之后或在可视模式下使用以选择对象。
标记命令 操作 在操作待定和可视模式下
------------------------------------------------------------------------------
v_aquote a" 双引号字符串 v_a' a' 单引号字符串 v_a( a( 与 ab 相同 v_a) a) 与 ab 相同 v_a< a< "a <>" 从 '<' 到匹配的 '>' v_a> a> 与 a< 相同 v_aB aB "一个块" 从 [{]}(带括号) v_aW aW "一个词"(带空格) v_a[ a[ "a []" 从 '[' 到匹配的 ']' v_a] a] 与 a[ 相同 v_a` a` 反引号中的字符串 v_ab ab "一个块" 从 "[(" 到 "])"(带大括号) v_ap ap "一个段落"(带空格) v_as as "一个句子"(带空格) v_at at "一个标记块"(带空格) v_aw aw "一个词"(带空格) v_a{ a{ 与 aB 相同 v_a} a} 与 aB 相同 v_iquote i" 双引号字符串(不含引号) v_i' i' 单引号字符串(不含引号) v_i( i( 与 ib 相同 v_i) i) 与 ib 相同 v_i< i< "内部 <>" 从 '<' 到匹配的 '>' v_i> i> 与 i< 相同 v_iB iB "内部块" 从 [{]} v_iW iW "内部词" v_i[ i[ "内部 []" 从 '[' 到匹配的 ']' v_i] i] 与 i[ 相同 v_i` i` 反引号中的字符串(不含反引号) v_ib ib "内部块" 从 "[(" 到 "])" v_ip ip "内部段落" v_is is "内部句子" v_it it "内部标记块" v_iw iw "内部词" v_i{ i{ 与 iB 相同 v_i} i} 与 iB 相同

2.2 窗口命令 CTRL-W

标记 命令 操作 在正常模式下
------------------------------------------------------------------------------
CTRL-W_CTRL-B CTRL-W CTRL-B 等同于 "CTRL-W b" CTRL-W_CTRL-C CTRL-W CTRL-C 等同于 "CTRL-W c" CTRL-W_CTRL-D CTRL-W CTRL-D 等同于 "CTRL-W d" CTRL-W_CTRL-F CTRL-W CTRL-F 等同于 "CTRL-W f" CTRL-W CTRL-G 等同于 "CTRL-W g .." CTRL-W_CTRL-H CTRL-W CTRL-H 等同于 "CTRL-W h" CTRL-W_CTRL-I CTRL-W CTRL-I 等同于 "CTRL-W i" CTRL-W_CTRL-J CTRL-W CTRL-J 等同于 "CTRL-W j" CTRL-W_CTRL-K CTRL-W CTRL-K 等同于 "CTRL-W k" CTRL-W_CTRL-L CTRL-W CTRL-L 等同于 "CTRL-W l" CTRL-W_CTRL-N CTRL-W CTRL-N 等同于 "CTRL-W n" CTRL-W_CTRL-O CTRL-W CTRL-O 等同于 "CTRL-W o" CTRL-W_CTRL-P CTRL-W CTRL-P 等同于 "CTRL-W p" CTRL-W_CTRL-Q CTRL-W CTRL-Q 等同于 "CTRL-W q" CTRL-W_CTRL-R CTRL-W CTRL-R 等同于 "CTRL-W r" CTRL-W_CTRL-S CTRL-W CTRL-S 等同于 "CTRL-W s" CTRL-W_CTRL-T CTRL-W CTRL-T 等同于 "CTRL-W t" CTRL-W_CTRL-V CTRL-W CTRL-V 等同于 "CTRL-W v" CTRL-W_CTRL-W CTRL-W CTRL-W 等同于 "CTRL-W w" CTRL-W_CTRL-X CTRL-W CTRL-X 等同于 "CTRL-W x" CTRL-W_CTRL-Z CTRL-W CTRL-Z 等同于 "CTRL-W z" CTRL-W_CTRL-] CTRL-W CTRL-] 等同于 "CTRL-W ]" CTRL-W_CTRL-^ CTRL-W CTRL-^ 等同于 "CTRL-W ^" CTRL-W_CTRL-_ CTRL-W CTRL-_ 等同于 "CTRL-W _" CTRL-W_+ CTRL-W + 增加当前窗口高度 N 行 CTRL-W_- CTRL-W - 减少当前窗口高度 N 行 CTRL-W_< CTRL-W < 减少当前窗口宽度 N 列 CTRL-W_= CTRL-W = 将所有窗口高度和宽度调整一致 CTRL-W_> CTRL-W > 增加当前窗口宽度 N 列 CTRL-W_H CTRL-W H 将当前窗口移到最左侧 CTRL-W_J CTRL-W J 将当前窗口移到底部 CTRL-W_K CTRL-W K 将当前窗口移到顶部 CTRL-W_L CTRL-W L 将当前窗口移到最右侧 CTRL-W_P CTRL-W P 转到预览窗口 CTRL-W_R CTRL-W R 将窗口向上旋转 N 次 CTRL-W_S CTRL-W S 等同于 "CTRL-W s" CTRL-W_T CTRL-W T 将当前窗口移到一个新的标签页 CTRL-W_W CTRL-W W 转到第 N 个前一个窗口(循环) CTRL-W_] CTRL-W ] 分割窗口并跳转到光标下的标签 CTRL-W_^ CTRL-W ^ 分割当前窗口并编辑备用文件 N CTRL-W__ CTRL-W _ 将当前窗口高度设置为 N(默认:非常高) CTRL-W_b CTRL-W b 转到最下面的窗口 CTRL-W_c CTRL-W c 关闭当前窗口(类似于 :closeCTRL-W_d CTRL-W d 分割窗口并跳转到光标下的定义 CTRL-W_f CTRL-W f 分割窗口并编辑光标下的文件名 CTRL-W_F CTRL-W F 分割窗口并编辑光标下的文件名,并跳转到文件名后面的行号。 CTRL-W_g_CTRL-] CTRL-W g CTRL-] 分割窗口并执行 :tjump 跳转到光标下的标签 CTRL-W_g] CTRL-W g ] 分割窗口并执行 :tselect 选择光标下的标签 CTRL-W_g} CTRL-W g } 执行 :ptjump 跳转到光标下的标签 CTRL-W_gf CTRL-W g f 在一个新的标签页编辑光标下的文件名 CTRL-W_gF CTRL-W g F 在一个新的标签页编辑光标下的文件名,并跳转到文件名后面的行号。 CTRL-W_gt CTRL-W g t 等同于 gt:转到下一个标签页 CTRL-W_gT CTRL-W g T 等同于 gT:转到上一个标签页 CTRL-W_g<Tab> CTRL-W g <Tab> 等同于 g<Tab>:转到最后访问的标签页 CTRL-W_h CTRL-W h 转到第 N 个左边的窗口(在第一个窗口停止) CTRL-W_i CTRL-W i 分割窗口并跳转到光标下的标识符的声明 CTRL-W_j CTRL-W j 向下移动 N 个窗口(在最后一个窗口停止) CTRL-W_k CTRL-W k 向上移动 N 个窗口(在第一个窗口停止) CTRL-W_l CTRL-W l 转到第 N 个右边的窗口(在最后一个窗口停止) CTRL-W_n CTRL-W n 打开一个新窗口,高度为 N 行 CTRL-W_o CTRL-W o 关闭除当前窗口之外的所有窗口(类似于 :onlyCTRL-W_p CTRL-W p 转到前一个(最后访问的)窗口 CTRL-W_q CTRL-W q 退出当前窗口(类似于 :quitCTRL-W_r CTRL-W r 将窗口向下旋转 N 次 CTRL-W_s CTRL-W s 将当前窗口分成两部分,新窗口高度为 N 行 CTRL-W_t CTRL-W t 转到最上面的窗口 CTRL-W_v CTRL-W v 垂直分割当前窗口,新窗口宽度为 N 列 CTRL-W_w CTRL-W w 转到第 N 个下一个窗口(循环) CTRL-W_x CTRL-W x 交换当前窗口与第 N 个窗口(默认:下一个窗口) CTRL-W_z CTRL-W z 关闭预览窗口 CTRL-W_bar CTRL-W | 将窗口宽度设置为 N 列 CTRL-W_} CTRL-W } 在预览窗口中显示光标下的标签 CTRL-W_<Down> CTRL-W <Down> 等同于 "CTRL-W j" CTRL-W_<Up> CTRL-W <Up> 等同于 "CTRL-W k" CTRL-W_<Left> CTRL-W <Left> 等同于 "CTRL-W h" CTRL-W_<Right> CTRL-W <Right> 等同于 "CTRL-W l"

2.3 方括号命令 [ ]

标签 字符 注意 在普通模式下的操作
------------------------------------------------------------------------------
[_CTRL-D [ CTRL-D 跳转到当前文件和包含文件中匹配光标下单词的第一个 #define,从当前文件的开头开始搜索 [_CTRL-I [ CTRL-I 跳转到当前文件和包含文件中包含光标下单词的第一行,从当前文件的开头开始搜索 [# [# 1 光标移动到前面 N 个不匹配的 #if、#else 或 #ifdef [' [' 1 光标移动到前面的小写标记,在第一个非空白字符上 [( [( 1 光标向后移动 N 次,到不匹配的 '(' [star [* 1 等同于 "[/" [` [ 1 光标移动到前面的小写标记 [/ [/ 1 光标移动到前面 N 个 C 注释的开头 [D [D 列出当前文件和包含文件中匹配光标下单词的所有 defines,从当前文件的开头开始搜索 [I [I 列出当前文件和包含文件中包含光标下单词的所有行,从当前文件的开头开始搜索 [P [P 2 等同于 "[p" [[ [[ 1 光标向后移动 N 个节 [] [] 1 光标向后移动 N 个节 [c [c 1 光标向后移动 N 次,到更改的开头 [d [d 显示当前文件和包含文件中匹配光标下单词的第一个 #define,从当前文件的开头开始搜索 [f [f 等同于 "gf" [i [i 显示当前文件和包含文件中包含光标下单词的第一行,从当前文件的开头开始搜索 [m [m 1 光标向后移动 N 次,到成员函数的开头 [p [p 2 类似于 "P",但调整缩进到当前行 [s [s 1 移动到前一个拼写错误的单词 [z [z 1 移动到打开折叠的开头 [{ [{ 1 光标向后移动 N 次,到不匹配的 '{' [<MiddleMouse> [<MiddleMouse> 2 等同于 "[p"
]_CTRL-D ] CTRL-D 跳转到当前文件和包含文件中匹配光标下单词的第一个 #define,从光标位置开始搜索 ]_CTRL-I ] CTRL-I 跳转到当前文件和包含文件中包含光标下单词的第一行,从光标位置开始搜索 ]# ]# 1 光标移动到下一个 N 个不匹配的 #endif 或 #else ]' ]' 1 光标移动到下一个小写标记,在第一个非空白字符上 ]) ]) 1 光标向前移动 N 次,到不匹配的 ')' ]star ]* 1 等同于 "]/" ]` ]` 1 光标移动到下一个小写标记 ]/ ]/ 1 光标移动到下一个 N 个 C 注释的结尾 ]D ]D 列出当前文件和包含文件中匹配光标下单词的所有 defines,从光标位置开始搜索 ]I ]I 列出当前文件和包含文件中包含光标下单词的所有行,从光标位置开始搜索 ]P ]P 2 等同于 "[p" ][ ][ 1 光标向前移动 N 个节 ]] ]] 1 光标向前移动 N 个节 ]c ]c 1 光标向前移动 N 次,到更改的开头 ]d ]d 显示当前文件和包含文件中匹配光标下单词的第一个 #define,从光标位置开始搜索 ]f ]f 等同于 "gf" ]i ]i 显示当前文件和包含文件中包含光标下单词的第一行,从光标位置开始搜索 ]m ]m 1 光标向前移动 N 次,到成员函数的结尾 ]p ]p 2 类似于 "p",但调整缩进到当前行 ]s ]s 1 移动到下一个拼写错误的单词 ]z ]z 1 移动到打开折叠的结尾 ]} ]} 1 光标向前移动 N 次,到不匹配的 '}' ]<MiddleMouse> ]<MiddleMouse> 2 等同于 "]p"

2.4 以 'g' 开头的命令 g

标签 字符 注意 在普通模式下的操作
------------------------------------------------------------------------------
g_CTRL-G g CTRL-G 显示当前光标位置的信息 g_CTRL-H g CTRL-H 启动选择块模式 g_CTRL-] g CTRL-] :tjump 跳转到光标下的标签 g# g# 1 与 "#" 相似,但不使用 "\<" 和 "\>" g$ g$ 1 当 'wrap' 关闭时,跳转到当前屏幕上当前行的最右字符;当 'wrap' 打开时,跳转到当前屏幕行的最右字符 g& g& 2 在所有行上重复最后的 ":s" g' g'{mark} 1 与 ' 相似,但不改变跳跃列表 g` g`{mark} 1 与 ` 相似,但不改变跳跃列表 gstar g* 1 与 "*" 相似,但不使用 "\<" 和 "\>" g+ g+ 跳转到 N 次更新的文本状态 g, g, 1 跳转到更改列表中更新的 N 个位置 g- g- 跳转到 N 次旧的文本状态 g0 g0 1 当 'wrap' 关闭时,跳转到当前屏幕上当前行的最左字符;当 'wrap' 打开时,跳转到当前屏幕行的最左字符 g8 g8 打印光标下 UTF-8 字符中使用的字节的十六进制值 g; g; 1 跳转到更改列表中旧的 N 个位置 g< g< 显示之前的命令输出 g? g? 2 Rot13 编码操作符 g?g? g?? 2 Rot13 编码当前行 g?g? g?g? 2 Rot13 编码当前行 gD gD 1 跳转到当前文件中光标下单词的定义 gE gE 1 向后跳转到前一个单词的结尾 gH gH 启动选择行模式 gI gI 2 与 "I" 相似,但始终从第 1 列开始 gJ gJ 2 合并行,但不插入空格 gN gN 1,2 找到上次使用搜索模式的之前匹配项并视觉选择它 gP ["x]gP 2 在光标前粘贴 N 次文本 [来自寄存器 x],将光标留在其后 gQ gQ 切换到 Vim 编辑的 "Ex" 模式 gR gR 2 进入虚拟替换模式 gT gT 跳转到上一个标签页 gU gU{motion} 2 将 Nmove 文本大写 gV gV 在选择模式下执行映射或菜单时,不要重新选择之前的视觉区域 g] g] :tselect 在光标下的标签上 g^ g^ 1 当 'wrap' 关闭时,跳转到当前屏幕上当前行的最左非空白字符;当 'wrap' 打开时,跳转到当前屏幕行的最左非空白字符 g_ g_ 1 光标到 N - 1 行更低的最后一个字符 ga ga 打印光标下字符的 ASCII 值 gd gd 1 跳转到当前函数中光标下单词的定义 ge ge 1 向后跳转到前一个单词的结尾 gf gf 开始编辑光标下方的文件名 gF gF 开始编辑光标下方的文件名,并跳转到文件名后的行号。 gg gg 1 光标到第 N 行,默认第一行 gh gh 启动选择模式 gi gi 2 与 "i" 相似,但首先移动到 '^ 标记 gj gj 1 与 "j" 相似,但当 'wrap' 打开时,向下移动 N 个屏幕行 gk gk 1 与 "k" 相似,但当 'wrap' 打开时,向上移动 N 个屏幕行 gm gm 1 跳转到屏幕行的中间字符 gM gM 1 跳转到文本行的中间字符 gn gn 1,2 找到上次使用搜索模式的下一个匹配项并视觉选择它 go go 1 光标到缓冲区中的第 N 个字节 gp ["x]gp 2 在光标后粘贴 N 次文本 [来自寄存器 x],将光标留在其后 gq gq{motion} 2 格式化 Nmove 文本 gr gr{char} 2 虚拟替换 N 个字符为 {char} gs gs 休眠 N 秒(默认 1 秒) gt gt 跳转到下一个标签页 gu gu{motion} 2 将 Nmove 文本小写 gv gv 重新选择之前的视觉区域 gw gw{motion} 2 格式化 Nmove 文本并保留光标 netrw-gx gx 执行光标下文件名的应用程序(仅适用于 netrw 插件) g@ g@{motion} 调用 'operatorfunc' g~ g~{motion} 2 交换 Nmove 文本的大小写 g<Down> g<Down> 1 与 "gj" 相同 g<End> g<End> 1 与 "g$" 相同 g<Home> g<Home> 1 与 "g0" 相同 g<LeftMouse> g<LeftMouse> 与 <C-LeftMouse> 相同 g<MiddleMouse> 与 <C-MiddleMouse> 相同 g<RightMouse> g<RightMouse> 与 <C-RightMouse> 相同 g<Tab> g<Tab> 跳转到上次访问的标签页 g<Up> g<Up> 1 与 "gk" 相同

2.5 以 'z' 开头的命令 z

标签 字符 注意 在普通模式下的操作
------------------------------------------------------------------------------
z<CR> z<CR> 重新绘制,光标行到窗口顶部,光标在第一个非空白处 zN<CR> z{height}<CR> 重新绘制,使窗口高度为 {height}z+ z+ 光标在第 N 行(默认位于窗口下方),否则与 "z<CR>" 相似 z- z- 重新绘制,光标行位于窗口底部,光标在第一个非空白处 z. z. 重新绘制,光标行位于窗口中心,光标在第一个非空白处 z= z= 提供拼写建议 zA zA 打开一个关闭的折叠或关闭一个打开的折叠(递归) zC zC 递归关闭折叠 zD zD 递归删除折叠 zE zE 消除所有折叠 zF zF 为 N 行创建一个折叠 zG zG 临时将单词标记为拼写正确 zH zH 当 'wrap' 关闭时,向右滚动半个屏幕宽度 zL zL 当 'wrap' 关闭时,向左滚动半个屏幕宽度 zM zM 将 'foldlevel' 设置为零 zN zN 设置 'foldenable' zO zO 递归打开折叠 zR zR 将 'foldlevel' 设置为最深的折叠 zW zW 临时将单词标记为拼写错误 zX zX 重新应用 'foldlevel' z^ z^ 光标在第 N 行(默认位于窗口上方),否则与 "z-" 相似 za za 打开一个关闭的折叠,关闭一个打开的折叠 zb zb 重新绘制,光标行位于窗口底部 zc zc 关闭一个折叠 zd zd 删除一个折叠 ze ze 当 'wrap' 关闭时,水平滚动以将光标定位在屏幕的末尾(右侧) zf zf{motion} 为 Nmove 文本创建一个折叠 zg zg 永久将单词标记为拼写正确 zh zh 当 'wrap' 关闭时,将屏幕向右滚动 N 个字符 zi zi 切换 'foldenable' zj zj 1 移动到下一个折叠的开头 zk zk 1 移动到前一个折叠的结尾 zl zl 当 'wrap' 关闭时,将屏幕向左滚动 N 个字符 zm zm 从 'foldlevel' 中减去 1 zn zn 重置 'foldenable' zo zo 打开折叠 zp zp 在块模式下粘贴,不带尾随空格 zP zP 在块模式下粘贴,不带尾随空格 zr zr 将 'foldlevel' 加 1 zs zs 当 'wrap' 关闭时,水平滚动以将光标定位在屏幕的开头(左侧) zt zt 重新绘制,光标行位于窗口顶部 zuw zuw 撤销 zw zug zug 撤销 zg zuW zuW 撤销 zW zuG zuG 撤销 zG zv zv 打开足够的折叠以查看光标行 zw zw 永久将单词标记为拼写错误 zx zx 重新应用 'foldlevel' 并执行 "zv" zy zy 不带尾随空格地 yank zz zz 重新绘制,光标行位于窗口中心 z<Left> z<Left> 与 "zh" 相同 z<Right> z<Right> 与 "zl" 相同

2.6 操作符挂起模式 operator-pending-index

这些可以在操作符之后使用,但在输入 {motion} 之前使用。
操作符挂起模式中的标记字符操作
------------------------------------------------------------------------------
o_v v 强制操作符按字符工作 o_V V 强制操作符按行工作 o_CTRL-V CTRL-V 强制操作符按块工作

3. 视觉模式 visual-index

视觉模式中的大多数命令与普通模式中的相同。这里列出的命令是不同的。
视觉模式中的标记命令说明操作
------------------------------------------------------------------------------
v_CTRL-\_CTRL-N CTRL-\ CTRL-N 停止可视模式 v_CTRL-\_CTRL-G CTRL-\ CTRL-G 转到普通模式 v_CTRL-A CTRL-A 2 在突出显示的文本中的数字中添加 N v_CTRL-C CTRL-C 停止可视模式 v_CTRL-G CTRL-G 在可视模式和选择模式之间切换 v_<BS> <BS> 2 选择模式:删除突出显示区域 v_CTRL-H CTRL-H 2 与 <BS> 相同 v_CTRL-O CTRL-O 从选择模式切换到可视模式以执行一个命令 v_CTRL-V CTRL-V 使可视模式变为块状或停止可视模式 v_CTRL-X CTRL-X 2 从突出显示的文本中的数字中减去 N v_<Esc> <Esc> 停止可视模式 v_CTRL-] CTRL-] 跳到突出显示的标签 v_! !{filter} 2 通过外部命令 {filter} 过滤突出显示的行 v_: : 使用突出显示的行作为范围开始命令行 v_< < 2 将突出显示的行向左移动一个 'shiftwidth' v_= = 2 通过使用 'equalprg' 选项给出的外部程序过滤突出显示的行 v_> > 2 将突出显示的行向右移动一个 'shiftwidth' v_b_A A 2 块模式:在突出显示区域之后,在所有行中追加相同的文本 v_C C 2 删除突出显示的行并开始插入 v_D D 2 删除突出显示的行 v_b_I I 2 块模式:在突出显示区域之前,在所有行中插入相同的文本 v_J J 2 连接突出显示的行 v_K K 对突出显示区域运行 'keywordprg' v_O O 水平移动到区域的另一个角 v_P P 使用寄存器的内容替换突出显示的区域;寄存器保持不变 v_R R 2 删除突出显示的行并开始插入 v_S S 2 删除突出显示的行并开始插入 v_U U 2 使突出显示的区域变为大写 v_V V 使可视模式变为行状或停止可视模式 v_X X 2 删除突出显示的行 v_Y Y 复制突出显示的行 v_aquote a" 使用双引号字符串扩展突出显示的区域 v_a' a' 使用单引号字符串扩展突出显示的区域 v_a( a( 与 ab 相同 v_a) a) 与 ab 相同 v_a< a< 使用 <> 块扩展突出显示的区域 v_a> a> 与 a< 相同 v_aB aB 使用 {} 块扩展突出显示的区域 v_aW aW 使用 "a WORD" 扩展突出显示的区域 v_a[ a[ 使用 [] 块扩展突出显示的区域 v_a] a] 与 a[ 相同 v_a` a` 使用反引号字符串扩展突出显示的区域 v_ab ab 使用 () 块扩展突出显示的区域 v_ap ap 使用段落扩展突出显示的区域 v_as as 使用句子扩展突出显示的区域 v_at at 使用标签块扩展突出显示的区域 v_aw aw 使用 "a word" 扩展突出显示的区域 v_a{ a{ 与 aB 相同 v_a} a} 与 aB 相同 v_c c 2 删除突出显示的区域并开始插入 v_d d 2 删除突出显示的区域 v_g_CTRL-A g CTRL-A 2 在突出显示的文本中的数字中添加 N v_g_CTRL-X g CTRL-X 2 从突出显示的文本中的数字中减去 N v_gJ gJ 2 连接突出显示的行,不插入空格 v_gq gq 2 格式化突出显示的行 v_gv gv 交换当前和上一个突出显示的区域 v_iquote i" 使用双引号字符串扩展突出显示的区域(不带引号) v_i' i' 使用单引号字符串扩展突出显示的区域(不带引号) v_i( i( 与 ib 相同 v_i) i) 与 ib 相同 v_i< i< 使用内部 <> 块扩展突出显示的区域 v_i> i> 与 i< 相同 v_iB iB 使用内部 {} 块扩展突出显示的区域 v_iW iW 使用 "内部 WORD" 扩展突出显示的区域 v_i[ i[ 使用内部 [] 块扩展突出显示的区域 v_i] i] 与 i[ 相同 v_i` i` 使用反引号字符串扩展突出显示的区域(不带反引号) v_ib ib 使用内部 () 块扩展突出显示的区域 v_ip ip 使用内部段落扩展突出显示的区域 v_is is 使用内部句子扩展突出显示的区域 v_it it 使用内部标签块扩展突出显示的区域 v_iw iw 使用 "内部 word" 扩展突出显示的区域 v_i{ i{ 与 iB 相同 v_i} i} 与 iB 相同 v_o o 将光标移动到区域的另一个角 v_p p 使用寄存器的内容替换突出显示的区域;未命名寄存器中的已删除文本 v_r r 2 用一个字符替换突出显示的区域 v_s s 2 删除突出显示的区域并开始插入 v_u u 2 使突出显示的区域变为小写 v_v v 使可视模式变为字符状或停止可视模式 v_x x 2 删除突出显示的区域 v_y y 复制突出显示的区域 v_~ ~ 2 交换突出显示区域的大小写

4. 命令行编辑 ex-edit-index

使用 ':', '!', '/' 或 '?' 命令进入命令行。普通字符将插入到当前光标位置。"完成" 在下面指的是上下文相关的完成。它将根据需要完成文件名、标签、命令等。
命令行编辑模式下的标签命令操作
------------------------------------------------------------------------------
CTRL-@ 未使用 c_CTRL-A CTRL-A 对光标前的模式进行完成并插入所有匹配项 c_CTRL-B CTRL-B 光标移动到命令行的开头 c_CTRL-C CTRL-C<Esc> 相同 c_CTRL-D CTRL-D 列出与光标前的模式匹配的完成项 c_CTRL-E CTRL-E 光标移动到命令行的结尾 'cedit' CTRL-F 'cedit' 的默认值:打开命令行窗口;否则未使用 c_CTRL-G CTRL-G'incsearch' 处于活动状态时,下一个匹配项 c_<BS> <BS> 删除光标前的字符 c_digraph {char1} <BS> {char2}'digraph' 处于打开状态时输入二合字 c_CTRL-H CTRL-H<BS> 相同 c_<Tab> <Tab> 如果 'wildchar'<Tab>:对光标前的模式进行完成 c_<S-Tab> <S-Tab>CTRL-P 相同 c_wildchar 'wildchar' 对光标前的模式进行完成(默认:<Tab>c_CTRL-I CTRL-I<Tab> 相同 c_<NL> <NL><CR> 相同 c_CTRL-J CTRL-J<CR> 相同 c_CTRL-K CTRL-K {char1} {char2} 输入二合字 c_CTRL-L CTRL-L 对光标前的模式进行完成并插入最长公共部分 c_<CR> <CR> 执行输入的命令 c_CTRL-M CTRL-M<CR> 相同 c_CTRL-N CTRL-N 使用完 'wildchar' 并且存在多个匹配项后:转到下一个匹配项,否则:从历史记录中调用较旧的命令行。 CTRL-O 未使用 c_CTRL-P CTRL-P 使用完 'wildchar' 并且存在多个匹配项后:转到上一个匹配项,否则:从历史记录中调用较旧的命令行。 c_CTRL-Q CTRL-QCTRL-V 相同,除非它用于终端控制流 c_CTRL-R CTRL-R {regname} 插入光标下的寄存器或对象的内容,如同输入一样 c_CTRL-R_CTRL-R CTRL-R CTRL-R {regname} c_CTRL-R_CTRL-O CTRL-R CTRL-O {regname} 按字面意思插入光标下的寄存器或对象的内容 CTRL-S 未使用,或用于终端控制流 c_CTRL-T CTRL-T'incsearch' 处于活动状态时,上一个匹配项 c_CTRL-U CTRL-U 删除所有字符 c_CTRL-V CTRL-V 按字面意思插入下一个非数字,将三位数的十进制数插入为单个字节。 c_CTRL-W CTRL-W 删除光标前的单词 CTRL-X 未使用(保留用于完成) CTRL-Y 复制(复制)无模式选择 CTRL-Z 未使用(保留用于挂起) c_<Esc> <Esc> 丢弃命令行,不执行它 c_CTRL-[ CTRL-[<Esc> 相同 c_CTRL-\_CTRL-N CTRL-\ CTRL-N 转到普通模式,丢弃命令行 c_CTRL-\_CTRL-G CTRL-\ CTRL-G 转到普通模式,丢弃命令行 CTRL-\ a - d 为扩展保留 CTRL-\ e {expr} 使用 {expr} 的结果替换命令行 CTRL-\ f - z 为扩展保留 CTRL-\ 其他未使用 c_CTRL-] CTRL-] 触发缩写 c_CTRL-^ CTRL-^ 切换使用 :lmap 映射 c_<Del> <Del> 删除光标下的字符
c_<Left> <Left> 光标左移 c_<S-Left> <S-Left> 光标左移一个单词 c_<C-Left> <C-Left> 光标左移一个单词 c_<Right> <Right> 光标右移 c_<S-Right> <S-Right> 光标右移一个单词 c_<C-Right> <C-Right> 光标右移一个单词 c_<Up> <Up> 从历史记录中调用与光标前的模式匹配的上一条命令行 c_<S-Up> <S-Up> 从历史记录中调用上一条命令行 c_<Down> <Down> 从历史记录中调用与光标前的模式匹配的下一条命令行 c_<S-Down> <S-Down> 从历史记录中调用下一条命令行 c_<Home> <Home> 光标移动到命令行的开头 c_<End> <End> 光标移动到命令行的结尾 c_<PageDown> <PageDown><S-Down> 相同 c_<PageUp> <PageUp><S-Up> 相同 c_<Insert> <Insert> 切换插入/覆盖模式 c_<LeftMouse> <LeftMouse> 光标移动到鼠标点击的位置
wildmenu 模式下的命令(参见 'wildmenu'
<Up> 向上移动到父级 <Down> 向下移动到子菜单 <Left> 选择上一个匹配 <Right> 选择下一个匹配 <CR> 在执行菜单补全时进入子菜单 CTRL-E 停止补全并返回到原始文本 CTRL-Y 接受选定的匹配并停止补全 其他 停止补全并插入键入的字符
在“wildmenu”模式下使用命令,其中 'wildoptions' 设置为“pum”
<PageUp> 选择几个条目之前的匹配 <PageDown> 选择几个条目之后的匹配

5. 终端模式 terminal-mode-index

终端 缓冲区中,除 CTRL-\ 之外的所有键都会转发到终端作业。如果按下 CTRL-\,则会转发下一个键,除非它是 CTRL-NCTRL-O。使用 CTRL-\_CTRL-N 进入普通模式。使用 t_CTRL-\_CTRL-O 执行一个普通模式命令,然后返回到终端模式。
你找到了,亚瑟! holy-grail
这是一份简短但完整的 ":" 命令列表,没有提到任何参数。命令名称的可选部分位于方括号内。这些命令按其名称的非可选部分排序。
标记 命令 动作
------------------------------------------------------------------------------
: : nothing :range :{range} go to last line in {range} :! :! filter lines or execute an external command :!! :!! repeat last ":!" command :# :# same as ":number" :& :& repeat last ":substitute" :star :* use the last Visual area, like ":'<,'>" :< :< shift lines one 'shiftwidth' left := := print the last line number :> :> shift lines one 'shiftwidth' right :@ :@ execute contents of a register :@@ :@@ repeat the previous ":@" :2match :2mat[ch] define a second match to highlight :3match :3mat[ch] define a third match to highlight :Next :N[ext] go to previous file in the argument list :append :a[ppend] append text :abbreviate :ab[breviate] enter abbreviation :abclear :abc[lear] remove all abbreviations :aboveleft :abo[veleft] make split window appear left or above :all :al[l] open a window for each file in the argument list :amenu :am[enu] enter new menu item for all modes :anoremenu :an[oremenu] enter a new menu for all modes that will not be remapped :args :ar[gs] print the argument list :argadd :arga[dd] add items to the argument list :argdedupe :argded[upe] remove duplicates from the argument list :argdelete :argd[elete] delete items from the argument list :argedit :arge[dit] add item to the argument list and edit it :argdo :argdo do a command on all items in the argument list :argglobal :argg[lobal] define the global argument list :arglocal :argl[ocal] define a local argument list :argument :argu[ment] go to specific file in the argument list :ascii :as[cii] print ascii value of character under the cursor :autocmd :au[tocmd] enter or show autocommands :augroup :aug[roup] select the autocommand group to use :aunmenu :aun[menu] remove menu for all modes :buffer :b[uffer] go to specific buffer in the buffer list :bNext :bN[ext] go to previous buffer in the buffer list :ball :ba[ll] open a window for each buffer in the buffer list :badd :bad[d] add buffer to the buffer list :balt :balt like ":badd" but also set the alternate file :bdelete :bd[elete] remove a buffer from the buffer list :belowright :bel[owright] make split window appear right or below :bfirst :bf[irst] go to first buffer in the buffer list :blast :bl[ast] go to last buffer in the buffer list :bmodified :bm[odified] go to next buffer in the buffer list that has been modified :bnext :bn[ext] go to next buffer in the buffer list :botright :bo[tright] make split window appear at bottom or far right :bprevious :bp[revious] go to previous buffer in the buffer list :brewind :br[ewind] go to first buffer in the buffer list :break :brea[k] break out of while loop :breakadd :breaka[dd] add a debugger breakpoint :breakdel :breakd[el] delete a debugger breakpoint :breaklist :breakl[ist] list debugger breakpoints :browse :bro[wse] use file selection dialog :bufdo :bufdo execute command in each listed buffer :buffers :buffers list all files in the buffer list :bunload :bun[load] unload a specific buffer :bwipeout :bw[ipeout] really delete a buffer :change :c[hange] replace a line or series of lines :cNext :cN[ext] go to previous error :cNfile :cNf[ile] go to last error in previous file :cabbrev :ca[bbrev] like ":abbreviate" but for Command-line mode :cabclear :cabc[lear] clear all abbreviations for Command-line mode :cabove :cabo[ve] go to error above current line :caddbuffer :cad[dbuffer] add errors from buffer :caddexpr :cadde[xpr] add errors from expr :caddfile :caddf[ile] add error message to current quickfix list :cafter :caf[ter] go to error after current cursor :call :cal[l] call a function :catch :cat[ch] part of a :try command :cbefore :cbef[ore] go to error before current cursor :cbelow :cbel[ow] go to error below current line :cbottom :cbo[ttom] scroll to the bottom of the quickfix window :cbuffer :cb[uffer] parse error messages and jump to first error :cc :cc go to specific error :cclose :ccl[ose] close quickfix window :cd :cd change directory :cdo :cdo execute command in each valid error list entry :cfdo :cfd[o] execute command in each file in error list :center :ce[nter] format lines at the center :cexpr :cex[pr] read errors from expr and jump to first :cfile :cf[ile] read file with error messages and jump to first :cfirst :cfir[st] go to the specified error, default first one :cgetbuffer :cgetb[uffer] get errors from buffer :cgetexpr :cgete[xpr] get errors from expr :cgetfile :cg[etfile] read file with error messages :changes :changes print the change list :chdir :chd[ir] change directory :checkhealth :che[ckhealth] run healthchecks :checkpath :checkp[ath] list included files :checktime :checkt[ime] check timestamp of loaded buffers :chistory :chi[story] list the error lists :clast :cla[st] go to the specified error, default last one :clearjumps :cle[arjumps] clear the jump list :clist :cl[ist] list all errors :close :clo[se] close current window :cmap :cm[ap] like ":map" but for Command-line mode :cmapclear :cmapc[lear] clear all mappings for Command-line mode :cmenu :cme[nu] add menu for Command-line mode :cnext :cn[ext] go to next error :cnewer :cnew[er] go to newer error list :cnfile :cnf[ile] go to first error in next file :cnoremap :cno[remap] like ":noremap" but for Command-line mode :cnoreabbrev :cnorea[bbrev] like ":noreabbrev" but for Command-line mode :cnoremenu :cnoreme[nu] like ":noremenu" but for Command-line mode :copy :co[py] copy lines :colder :col[der] go to older error list :colorscheme :colo[rscheme] load a specific color scheme :command :com[mand] create user-defined command :comclear :comc[lear] clear all user-defined commands :compiler :comp[iler] do settings for a specific compiler :continue :con[tinue] go back to :while :confirm :conf[irm] prompt user when confirmation required :const :cons[t] create a variable as a constant :copen :cope[n] open quickfix window :cprevious :cp[revious] go to previous error :cpfile :cpf[ile] go to last error in previous file :cquit :cq[uit] quit Vim with an error code :crewind :cr[ewind] go to the specified error, default first one :cunmap :cu[nmap] like ":unmap" but for Command-line mode :cunabbrev :cuna[bbrev] like ":unabbrev" but for Command-line mode :cunmenu :cunme[nu] remove menu for Command-line mode :cwindow :cw[indow] open or close quickfix window :delete :d[elete] delete lines :debug :deb[ug] run a command in debugging mode :debuggreedy :debugg[reedy] read debug mode commands from normal input :delcommand :delc[ommand] delete user-defined command :delfunction :delf[unction] delete a user function :delmarks :delm[arks] delete marks :diffupdate :dif[fupdate] update 'diff' buffers :diffget :diffg[et] remove differences in current buffer :diffoff :diffo[ff] switch off diff mode :diffpatch :diffp[atch] apply a patch and show differences :diffput :diffpu[t] remove differences in other buffer :diffsplit :diffs[plit] show differences with another file :diffthis :diffthis make current window a diff window :digraphs :dig[raphs] show or enter digraphs :display :di[splay] display registers :djump :dj[ump] jump to #define :dl :dl short for :delete with the 'l' flag :dlist :dli[st] list #defines :doautocmd :do[autocmd] apply autocommands to current buffer :doautoall :doautoa[ll] apply autocommands for all loaded buffers :dp :d[elete]p short for :delete with the 'p' flag :drop :dr[op] jump to window editing file or edit file in current window :dsearch :ds[earch] list one #define :dsplit :dsp[lit] split window and jump to #define :edit :e[dit] edit a file :earlier :ea[rlier] go to older change, undo :echo :ec[ho] echoes the result of expressions :echoerr :echoe[rr] like :echo, show like an error and use history :echohl :echoh[l] set highlighting for echo commands :echomsg :echom[sg] same as :echo, put message in history :echon :echon same as :echo, but without <EOL> :else :el[se] part of an :if command :elseif :elsei[f] part of an :if command :emenu :em[enu] execute a menu by name :endif :en[dif] end previous :if :endfor :endfo[r] end previous :for :endfunction :endf[unction] end of a user function started with :function :endtry :endt[ry] end previous :try :endwhile :endw[hile] end previous :while :enew :ene[w] edit a new, unnamed buffer :eval :ev[al] evaluate an expression and discard the result :ex :ex same as ":edit" :execute :exe[cute] execute result of expressions :exit :exi[t] same as ":xit" :exusage :exu[sage] overview of Ex commands :fclose :fc[lose] close floating window :file :f[ile] show or set the current file name :files :files list all files in the buffer list :filetype :filet[ype] switch file type detection on/off :filter :filt[er] filter output of following command :find :fin[d] find file in 'path' and edit it :finally :fina[lly] part of a :try command :finish :fini[sh] quit sourcing a Vim script :first :fir[st] go to the first file in the argument list :fold :fo[ld] create a fold :foldclose :foldc[lose] close folds :folddoopen :foldd[oopen] execute command on lines not in a closed fold :folddoclosed :folddoc[losed] execute command on lines in a closed fold :foldopen :foldo[pen] open folds :for :for for loop :function :fu[nction] define a user function :global :g[lobal] execute commands for matching lines :goto :go[to] go to byte in the buffer :grep :gr[ep] run 'grepprg' and jump to first match :grepadd :grepa[dd] like :grep, but append to current list :gui :gu[i] start the GUI :gvim :gv[im] start the GUI :help :h[elp] open a help window :helpclose :helpc[lose] close one help window :helpgrep :helpg[rep] like ":grep" but searches help files :helptags :helpt[ags] generate help tags for a directory :highlight :hi[ghlight] specify highlighting methods :hide :hid[e] hide current buffer for a command :history :his[tory] print a history list :horizontal :hor[izontal] following window command work horizontally :insert :i[nsert] insert text :iabbrev :ia[bbrev] like ":abbrev" but for Insert mode :iabclear :iabc[lear] like ":abclear" but for Insert mode :if :if execute commands when condition met :ijump :ij[ump] jump to definition of identifier :ilist :il[ist] list lines where identifier matches :imap :im[ap] like ":map" but for Insert mode :imapclear :imapc[lear] like ":mapclear" but for Insert mode :imenu :ime[nu] add menu for Insert mode :inoremap :ino[remap] like ":noremap" but for Insert mode :inoreabbrev :inorea[bbrev] like ":noreabbrev" but for Insert mode :inoremenu :inoreme[nu] like ":noremenu" but for Insert mode :intro :int[ro] print the introductory message :isearch :is[earch] list one line where identifier matches :isplit :isp[lit] split window and jump to definition of identifier :iunmap :iu[nmap] like ":unmap" but for Insert mode :iunabbrev :iuna[bbrev] like ":unabbrev" but for Insert mode :iunmenu :iunme[nu] remove menu for Insert mode :join :j[oin] join lines :jumps :ju[mps] print the jump list :k :k set a mark :keepalt :keepa[lt] following command keeps the alternate file :keepmarks :kee[pmarks] following command keeps marks where they are :keepjumps :keepj[umps] following command keeps jumplist and marks :keeppatterns :keepp[atterns] following command keeps search pattern history :lNext :lN[ext] go to previous entry in location list :lNfile :lNf[ile] go to last entry in previous file :list :l[ist] print lines :labove :lab[ove] go to location above current line :laddexpr :lad[dexpr] add locations from expr :laddbuffer :laddb[uffer] add locations from buffer :laddfile :laddf[ile] add locations to current location list :lafter :laf[ter] go to location after current cursor :last :la[st] go to the last file in the argument list :language :lan[guage] set the language (locale) :later :lat[er] go to newer change, redo :lbefore :lbef[ore] go to location before current cursor :lbelow :lbel[ow] go to location below current line :lbottom :lbo[ttom] scroll to the bottom of the location window :lbuffer :lb[uffer] parse locations and jump to first location :lcd :lc[d] change directory locally :lchdir :lch[dir] change directory locally :lclose :lcl[ose] close location window :ldo :ld[o] execute command in valid location list entries :lfdo :lfd[o] execute command in each file in location list :left :le[ft] left align lines :leftabove :lefta[bove] make split window appear left or above :let :let assign a value to a variable or option :lexpr :lex[pr] read locations from expr and jump to first :lfile :lf[ile] read file with locations and jump to first :lfirst :lfir[st] go to the specified location, default first one :lgetbuffer :lgetb[uffer] get locations from buffer :lgetexpr :lgete[xpr] get locations from expr :lgetfile :lg[etfile] read file with locations :lgrep :lgr[ep] run 'grepprg' and jump to first match :lgrepadd :lgrepa[dd] like :grep, but append to current list :lhelpgrep :lh[elpgrep] like ":helpgrep" but uses location list :lhistory :lhi[story] list the location lists :ll :ll go to specific location :llast :lla[st] go to the specified location, default last one :llist :lli[st] list all locations :lmake :lmak[e] execute external command 'makeprg' and parse error messages :lmap :lm[ap] like ":map!" but includes Lang-Arg mode :lmapclear :lmapc[lear] like ":mapclear!" but includes Lang-Arg mode :lnext :lne[xt] go to next location :lnewer :lnew[er] go to newer location list :lnfile :lnf[ile] go to first location in next file :lnoremap :ln[oremap] like ":noremap!" but includes Lang-Arg mode :loadkeymap :loadk[eymap] load the following keymaps until EOF :loadview :lo[adview] load view for current window from a file :lockmarks :loc[kmarks] following command keeps marks where they are :lockvar :lockv[ar] lock variables :lolder :lol[der] go to older location list :lopen :lope[n] open location window :lprevious :lp[revious] go to previous location :lpfile :lpf[ile] go to last location in previous file :lrewind :lr[ewind] go to the specified location, default first one :ls :ls list all buffers :ltag :lt[ag] jump to tag and add matching tags to the location list :lunmap :lu[nmap] like ":unmap!" but includes Lang-Arg mode :lua :lua execute Lua command :luado :luad[o] execute Lua command for each line :luafile :luaf[ile] execute Lua script file :lvimgrep :lv[imgrep] search for pattern in files :lvimgrepadd :lvimgrepa[dd] like :vimgrep, but append to current list :lwindow :lw[indow] open or close location window :move :m[ove] move lines :mark :ma[rk] set a mark :make :mak[e] execute external command 'makeprg' and parse error messages :map :map show or enter a mapping :mapclear :mapc[lear] clear all mappings for Normal and Visual mode :marks :marks list all marks :match :mat[ch] define a match to highlight :menu :me[nu] enter a new menu item :menutranslate :menut[ranslate] add a menu translation item :messages :mes[sages] view previously displayed messages :mkexrc :mk[exrc] write current mappings and settings to a file :mksession :mks[ession] write session info to a file :mkspell :mksp[ell] produce .spl spell file :mkvimrc :mkv[imrc] write current mappings and settings to a file :mkview :mkvie[w] write view of current window to a file :mode :mod[e] show or change the screen mode :next :n[ext] go to next file in the argument list :new :new create a new empty window :nmap :nm[ap] like ":map" but for Normal mode :nmapclear :nmapc[lear] clear all mappings for Normal mode :nmenu :nme[nu] add menu for Normal mode :nnoremap :nn[oremap] like ":noremap" but for Normal mode :nnoremenu :nnoreme[nu] like ":noremenu" but for Normal mode :noautocmd :noa[utocmd] following commands don't trigger autocommands :noremap :no[remap] enter a mapping that will not be remapped :nohlsearch :noh[lsearch] suspend 'hlsearch' highlighting :noreabbrev :norea[bbrev] enter an abbreviation that will not be remapped :noremenu :noreme[nu] enter a menu that will not be remapped :normal :norm[al] execute Normal mode commands :noswapfile :nos[wapfile] following commands don't create a swap file :number :nu[mber] print lines with line number :nunmap :nun[map] like ":unmap" but for Normal mode :nunmenu :nunme[nu] remove menu for Normal mode :oldfiles :ol[dfiles] list files that have marks in the shada file :omap :om[ap] like ":map" but for Operator-pending mode :omapclear :omapc[lear] remove all mappings for Operator-pending mode :omenu :ome[nu] add menu for Operator-pending mode :only :on[ly] close all windows except the current one :onoremap :ono[remap] like ":noremap" but for Operator-pending mode :onoremenu :onoreme[nu] like ":noremenu" but for Operator-pending mode :options :opt[ions] open the options-window :ounmap :ou[nmap] like ":unmap" but for Operator-pending mode :ounmenu :ounme[nu] remove menu for Operator-pending mode :ownsyntax :ow[nsyntax] set new local syntax highlight for this window :packadd :pa[ckadd] add a plugin from 'packpath' :packloadall :packl[oadall] load all packages under 'packpath' :pclose :pc[lose] close preview window :pedit :ped[it] edit file in the preview window :perl :pe[rl] execute perl command :perldo :perld[o] execute perl command for each line :perlfile :perlf[ile] execute perl script file :print :p[rint] print lines :profdel :profd[el] stop profiling a function or script :profile :prof[ile] profiling functions and scripts :pop :po[p] jump to older entry in tag stack :popup :popu[p] popup a menu by name :ppop :pp[op] ":pop" in preview window :preserve :pre[serve] write all text to swap file :previous :prev[ious] go to previous file in argument list :psearch :ps[earch] like ":ijump" but shows match in preview window :ptag :pt[ag] show tag in preview window :ptNext :ptN[ext] :tNext in preview window :ptfirst :ptf[irst] :trewind in preview window :ptjump :ptj[ump] :tjump and show tag in preview window :ptlast :ptl[ast] :tlast in preview window :ptnext :ptn[ext] :tnext in preview window :ptprevious :ptp[revious] :tprevious in preview window :ptrewind :ptr[ewind] :trewind in preview window :ptselect :pts[elect] :tselect and show tag in preview window :put :pu[t] insert contents of register in the text :pwd :pw[d] print current directory :py3 :py3 execute Python 3 command :python3 :python3 same as :py3 :py3do :py3d[o] execute Python 3 command for each line :py3file :py3f[ile] execute Python 3 script file :python :py[thon] execute Python command :pydo :pyd[o] execute Python command for each line :pyfile :pyf[ile] execute Python script file :pyx :pyx execute python_x command :pythonx :pythonx same as :pyx :pyxdo :pyxd[o] execute python_x command for each line :pyxfile :pyxf[ile] execute python_x script file :quit :q[uit] quit current window (when one window quit Vim) :quitall :quita[ll] quit Vim :qall :qa[ll] quit Vim :read :r[ead] read file into the text :recover :rec[over] recover a file from a swap file :redo :red[o] redo one undone change :redir :redi[r] redirect messages to a file or register :redraw :redr[aw] force a redraw of the display :redrawstatus :redraws[tatus] force a redraw of the status line(s) and window bar(s) :redrawtabline :redrawt[abline] force a redraw of the tabline :registers :reg[isters] display the contents of registers :resize :res[ize] change current window height :retab :ret[ab] change tab size :return :retu[rn] return from a user function :rewind :rew[ind] go to the first file in the argument list :right :ri[ght] right align text :rightbelow :rightb[elow] make split window appear right or below :rshada :rsh[ada] read from shada file :ruby :rub[y] execute Ruby command :rubydo :rubyd[o] execute Ruby command for each line :rubyfile :rubyf[ile] execute Ruby script file :rundo :rund[o] read undo information from a file :runtime :ru[ntime] source vim scripts in 'runtimepath' :substitute :s[ubstitute] find and replace text :sNext :sN[ext] split window and go to previous file in argument list :sandbox :san[dbox] execute a command in the sandbox :sargument :sa[rgument] split window and go to specific file in argument list :sall :sal[l] open a window for each file in argument list :saveas :sav[eas] save file under another name. :sbuffer :sb[uffer] split window and go to specific file in the buffer list :sbNext :sbN[ext] split window and go to previous file in the buffer list :sball :sba[ll] open a window for each file in the buffer list :sbfirst :sbf[irst] split window and go to first file in the buffer list :sblast :sbl[ast] split window and go to last file in buffer list :sbmodified :sbm[odified] split window and go to modified file in the buffer list :sbnext :sbn[ext] split window and go to next file in the buffer list :sbprevious :sbp[revious] split window and go to previous file in the buffer list :sbrewind :sbr[ewind] split window and go to first file in the buffer list :scriptnames :scr[iptnames] list names of all sourced Vim scripts :scriptencoding :scripte[ncoding] encoding used in sourced Vim script :set :se[t] show or set options :setfiletype :setf[iletype] set 'filetype', unless it was set already :setglobal :setg[lobal] show global values of options :setlocal :setl[ocal] show or set options locally :sfind :sf[ind] split current window and edit file in 'path' :sfirst :sfir[st] split window and go to first file in the argument list :sign :sig[n] manipulate signs :silent :sil[ent] run a command silently :sleep :sl[eep] do nothing for a few seconds :slast :sla[st] split window and go to last file in the argument list :smagic :sm[agic] :substitute with 'magic' :smap :smap like ":map" but for Select mode :smapclear :smapc[lear] remove all mappings for Select mode :smenu :sme[nu] add menu for Select mode :snext :sn[ext] split window and go to next file in the argument list :snomagic :sno[magic] :substitute with 'nomagic' :snoremap :snor[emap] like ":noremap" but for Select mode :snoremenu :snoreme[nu] like ":noremenu" but for Select mode :sort :sor[t] sort lines :source :so[urce] read Vim or Ex commands from a file :spelldump :spelld[ump] split window and fill with all correct words :spellgood :spe[llgood] add good word for spelling :spellinfo :spelli[nfo] show info about loaded spell files :spellrare :spellra[re] add rare word for spelling :spellrepall :spellr[epall] replace all bad words like last z= :spellundo :spellu[ndo] remove good or bad word :spellwrong :spellw[rong] add spelling mistake :split :sp[lit] split current window :sprevious :spr[evious] split window and go to previous file in the argument list :srewind :sre[wind] split window and go to first file in the argument list :stop :st[op] suspend the editor or escape to a shell :stag :sta[g] split window and jump to a tag :startinsert :star[tinsert] start Insert mode :startgreplace :startg[replace] start Virtual Replace mode :startreplace :startr[eplace] start Replace mode :stopinsert :stopi[nsert] stop Insert mode :stjump :stj[ump] do ":tjump" and split window :stselect :sts[elect] do ":tselect" and split window :sunhide :sun[hide] same as ":unhide" :sunmap :sunm[ap] like ":unmap" but for Select mode :sunmenu :sunme[nu] remove menu for Select mode :suspend :sus[pend] same as ":stop" :sview :sv[iew] split window and edit file read-only :swapname :sw[apname] show the name of the current swap file :syntax :sy[ntax] syntax highlighting :syntime :synti[me] measure syntax highlighting speed :syncbind :sync[bind] sync scroll binding :t :t same as ":copy" :tNext :tN[ext] jump to previous matching tag :tabNext :tabN[ext] go to previous tab page :tabclose :tabc[lose] close current tab page :tabdo :tabdo execute command in each tab page :tabedit :tabe[dit] edit a file in a new tab page :tabfind :tabf[ind] find file in 'path', edit it in a new tab page :tabfirst :tabfir[st] go to first tab page :tablast :tabl[ast] go to last tab page :tabmove :tabm[ove] move tab page to other position :tabnew :tabnew edit a file in a new tab page :tabnext :tabn[ext] go to next tab page :tabonly :tabo[nly] close all tab pages except the current one :tabprevious :tabp[revious] go to previous tab page :tabrewind :tabr[ewind] go to first tab page :tabs :tabs list the tab pages and what they contain :tab :tab create new tab when opening new window :tag :ta[g] jump to tag :tags :tags show the contents of the tag stack :tcd :tc[d] change directory for tab page :tchdir :tch[dir] change directory for tab page :terminal :te[rminal] open a terminal buffer :tfirst :tf[irst] jump to first matching tag :throw :th[row] throw an exception :tjump :tj[ump] like ":tselect", but jump directly when there is only one match :tlast :tl[ast] jump to last matching tag :tlmenu :tlm[enu] add menu for Terminal-mode :tlnoremenu :tln[oremenu] like ":noremenu" but for Terminal-mode :tlunmenu :tlu[nmenu] remove menu for Terminal-mode :tmapclear :tmapc[lear] remove all mappings for Terminal-mode :tmap :tma[p] like ":map" but for Terminal-mode :tmenu :tm[enu] define menu tooltip :tnext :tn[ext] jump to next matching tag :tnoremap :tno[remap] like ":noremap" but for Terminal-mode :topleft :to[pleft] make split window appear at top or far left :tprevious :tp[revious] jump to previous matching tag :trewind :tr[ewind] jump to first matching tag :trust :trust add or remove file from trust database :try :try execute commands, abort on error or exception :tselect :ts[elect] list matching tags and select one :tunmap :tunma[p] like ":unmap" but for Terminal-mode :tunmenu :tu[nmenu] remove menu tooltip :undo :u[ndo] undo last change(s) :undojoin :undoj[oin] join next change with previous undo block :undolist :undol[ist] list leafs of the undo tree :unabbreviate :una[bbreviate] remove abbreviation :unhide :unh[ide] open a window for each loaded file in the buffer list :unlet :unl[et] delete variable :unlockvar :unlo[ckvar] unlock variables :unmap :unm[ap] remove mapping :unmenu :unme[nu] remove menu :unsilent :uns[ilent] run a command not silently :update :up[date] write buffer if modified :vglobal :v[global] execute commands for not matching lines :version :ve[rsion] print version number and other info :verbose :verb[ose] execute command with 'verbose' set :vertical :vert[ical] make following command split vertically :vimgrep :vim[grep] search for pattern in files :vimgrepadd :vimgrepa[dd] like :vimgrep, but append to current list :visual :vi[sual] same as ":edit", but turns off "Ex" mode :viusage :viu[sage] overview of Normal mode commands :view :vie[w] edit a file read-only :vmap :vm[ap] like ":map" but for Visual+Select mode :vmapclear :vmapc[lear] remove all mappings for Visual+Select mode :vmenu :vme[nu] add menu for Visual+Select mode :vnew :vne[w] create a new empty window, vertically split :vnoremap :vn[oremap] like ":noremap" but for Visual+Select mode :vnoremenu :vnoreme[nu] like ":noremenu" but for Visual+Select mode :vsplit :vs[plit] split current window vertically :vunmap :vu[nmap] like ":unmap" but for Visual+Select mode :vunmenu :vunme[nu] remove menu for Visual+Select mode :windo :windo execute command in each window :write :w[rite] write to a file :wNext :wN[ext] write to a file and go to previous file in argument list :wall :wa[ll] write all (changed) buffers :while :wh[ile] execute loop for as long as condition met :winsize :wi[nsize] get or set window size (obsolete) :wincmd :winc[md] execute a Window (CTRL-W) command :winpos :winp[os] get or set window position :wnext :wn[ext] write to a file and go to next file in argument list :wprevious :wp[revious] write to a file and go to previous file in argument list :wq :wq write to a file and quit window or Vim :wqall :wqa[ll] write all changed buffers and quit Vim :wshada :wsh[ada] write to ShaDa file :wundo :wu[ndo] write undo information to a file :xit :x[it] write if buffer changed and close window :xall :xa[ll] same as ":wqall" :xmapclear :xmapc[lear] remove all mappings for Visual mode :xmap :xm[ap] like ":map" but for Visual mode :xmenu :xme[nu] add menu for Visual mode :xnoremap :xn[oremap] like ":noremap" but for Visual mode :xnoremenu :xnoreme[nu] like ":noremenu" but for Visual mode :xunmap :xu[nmap] like ":unmap" but for Visual mode :xunmenu :xunme[nu] remove menu for Visual mode :yank :y[ank] yank lines into a register :z :z print some lines :~ :~ repeat last ":substitute"
主要
命令索引
快速参考