Vim 速查表
一份可搜索、可打印的 Vim 参考——模式、移动、编辑、查找与替换、窗口、缓冲区和寄存器。免费。
Modes
9Esc
Return to Normal mode
i / a
Insert before / after the cursor
I / A
Insert at start / end of the line
o / O
Open a new line below / above
v
Visual mode (character selection)
V
Visual line mode
Ctrl-v
Visual block mode (columns)
R
Replace mode (overtype)
:
Command-line (Ex) mode
Motions
10h j k l
Left, down, up, right
w / b
Forward / back one word
e / ge
End of next / previous word
0 / ^ / $
Line start / first non-blank / line end
gg / G
First line / last line
42G / :42
Jump to line 42
{ / }
Previous / next paragraph
%
Jump to matching bracket
f x / t x
Move to / before next x on the line
Ctrl-d / Ctrl-u
Scroll half page down / up
Editing operators
11x / X
Delete char under / before cursor
dd / D
Delete line / to end of line
dw / diw
Delete word / inner word
cc / C
Change line / to end of line
ciw / ci"
Change inner word / inside quotes
yy / yw
Yank (copy) line / word
p / P
Paste after / before the cursor
r x / ~
Replace one char / toggle case
u / Ctrl-r
Undo / redo
.
Repeat the last change
>> / <<
Indent / unindent the line
Visual mode
9v / V
Start character / line selection
Ctrl-v
Start block (column) selection
o
Jump to the other end of the selection
d / y
Delete / yank the selection
c
Change the selection
> / <
Indent / unindent the selection
gu / gU
Lowercase / uppercase the selection
gv
Reselect the last visual selection
I / A
Block insert before / append after (Ctrl-v)
Search & replace
9/pattern
Search forward for pattern
?pattern
Search backward for pattern
n / N
Next / previous match
* / #
Search word under cursor fwd / back
:%s/old/new/g
Replace all in the file
:%s/old/new/gc
Replace all with confirmation
:s/old/new/g
Replace all on the current line
:%s/\<word\>/x/g
Replace whole words only
:noh
Clear search highlighting
Windows & tabs
8:sp / :split
Horizontal split
:vsp / :vsplit
Vertical split
Ctrl-w h/j/k/l
Move to the split in that direction
Ctrl-w w
Cycle to the next split
Ctrl-w q / c
Close the current split
Ctrl-w o
Close all other splits
Ctrl-w =
Equalize split sizes
:tabnew / gt / gT
New tab / next / previous tab
Buffers & files
9:e file
Open / edit a file
:w / :w file
Save / save as
:wq / :x / ZZ
Save and quit
:q / :q!
Quit / quit discarding changes
:ls / :buffers
List open buffers
:b name / :bN
Switch to a buffer by name / number
:bn / :bp
Next / previous buffer
:bd
Delete (close) a buffer
:wa / :qa
Write all / quit all
Registers & marks
8"ayy
Yank line into register a
"ap
Paste from register a
"+y / "+p
Yank to / paste from system clipboard
:reg
Show register contents
ma
Set mark a at the cursor
`a / 'a
Jump to mark a (exact / line)
``
Jump back to the previous position
:marks
List all marks
Macros
7qa
Start recording into register a
q
Stop recording
@a
Play back macro a
@@
Repeat the last played macro
5@a
Play macro a five times
:%normal @a
Run macro a on every line
"ap → edit → "ay$
Paste, edit, then re-yank a macro to change it
没有条目匹配“:q”。
关于 Vim 速查表
这份 Vim 速查表按概念划分整理了这款编辑器:模式、移动、编辑操作符、可视模式、查找替换、窗口和标签页、缓冲区和文件、寄存器和标记,以及宏。每一行都是一个按键或命令,并附有一句话说明其作用。
Vim 靠肌肉记忆取胜,而培养肌肉记忆最快的方法,就是在需要时眼前正好有正确的移动命令或操作符。本速查表把这些可组合的元素——操作符、移动、计数——归类放在一起,让 Vim 的"语法"保持可见,而不是逐个按键死记硬背。
它免费且完全在客户端运行:用搜索框实时过滤每个按键,通过粘性目录在各章节间跳转,点击即可复制 Ex 命令,还能打印这份速查表——把打印件放在键盘旁边,依然是学习 Vim 的经典方式。
如何使用 Vim 速查表
- 如果你是新手,可以先看「模式」章节;如果已经熟悉,可以直接跳到「移动」和「编辑操作符」。
- 搜索 delete、replace 或 macro 等操作,即可过滤整份速查表。
- 使用粘性目录跳转到「寄存器与标记」或「窗口与标签页」等章节。
- 点击命令或其复制图标,即可复制查找替换模式等 Ex 命令。
- 打印速查表并放在键盘旁边,让这些移动命令逐渐变成肌肉记忆。
常见问题
共九个章节:模式、移动、编辑操作符、可视模式、查找替换、窗口和标签页、缓冲区和文件、寄存器和标记,以及宏——涵盖了这款编辑器的完整常用词汇。
有用。速查表涵盖的是 Vim 的核心行为——模式、移动、操作符、寄存器、宏——这些在 Neovim 中完全相同,因此无论你用的是哪一个,都同样适用。
先阅读「模式」章节,理解普通模式、插入模式和可视模式,然后学习少量的移动命令和操作符。由于 Vim 命令可以组合使用,少量词汇就已经能覆盖大部分编辑操作。
可以。打印按钮会去掉搜索框和导航栏,只输出按键和说明——打印出来的 Vim 速查表依然是学习 Vim 的经典方式。
是的,完全免费,可以在浏览器中搜索,也可以直接打印,无需任何账户。
热门搜索
vim 速查表
vim 命令列表
vim 快捷键
vim 查找和替换
vim 移动命令参考
vim 可视模式命令
vim 宏
如何退出 vim
需要帮助?
使用此工具时遇到问题?请告诉我们的团队。