Semua alat
Percuma

Rujukan Vim yang boleh dicari dan dicetak — mod, gerakan, penyuntingan, cari & ganti, tetingkap, penimbal dan daftar. Percuma.

Modes

9
Esc
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

10
h 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

11
x / 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

9
v / 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

7
qa
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

Tiada entri sepadan dengan “:q”.


Mengenai Helaian Rujukan Vim

Helaian rujukan Vim ini memetakan editor mengikut konsep: mod, motion, operator penyuntingan, mod visual, carian dan ganti, tetingkap dan tab, buffer dan fail, register dan mark, serta macro. Setiap baris ialah kekunci atau arahan dengan penerangan satu baris tentang apa yang dilakukannya.

Vim membalas ingatan otot (muscle memory), dan cara terpantas untuk membinanya ialah dengan mempunyai motion atau operator yang betul di hadapan anda apabila anda memerlukannya. Helaian ini mengekalkan bahagian-bahagian yang boleh digabungkan — operator, motion, kiraan — dikumpulkan supaya tatabahasa Vim kekal kelihatan berbanding dihafal satu kekunci pada satu masa.

Ia percuma dan sepenuhnya di sisi klien: tapis setiap kekunci secara langsung dengan kotak carian, lompat antara bahagian dari jadual kandungan yang melekat, klik untuk menyalin arahan Ex, dan cetak helaian — cara klasik untuk belajar Vim adalah dengan cetakan di sebelah papan kekunci.

Cara menggunakan Helaian Rujukan Vim

  1. Mulakan dengan bahagian Mod jika anda baharu, atau lompat terus ke Motion dan Operator penyuntingan.
  2. Cari tindakan seperti delete, replace atau macro untuk menapis keseluruhan helaian.
  3. Gunakan jadual kandungan yang melekat untuk melompat ke bahagian seperti Register & mark atau Tetingkap & tab.
  4. Klik arahan atau ikon salinnya untuk menyalin arahan Ex seperti corak search-and-replace.
  5. Cetak helaian dan simpan di sebelah papan kekunci anda semasa motion menjadi ingatan otot.

Soalan lazim

Sembilan bahagian: mod, motion, operator penyuntingan, mod visual, carian dan ganti, tetingkap dan tab, buffer dan fail, register dan mark, serta macro — keseluruhan kosa kata kerja editor ini.

Ya. Helaian ini merangkumi tingkah laku teras Vim — mod, motion, operator, register, macro — yang sama di Neovim, jadi semuanya terpakai tidak kira yang mana anda gunakan.

Baca bahagian Mod dahulu untuk memahami mod normal, insert dan visual, kemudian pelajari beberapa motion dan operator. Oleh kerana arahan Vim boleh digabungkan, kosa kata yang kecil sudah merangkumi kebanyakan penyuntingan.

Ya. Butang Cetak membuang bar carian dan navigasi serta menghasilkan hanya kekunci dan penerangan — helaian rujukan Vim yang dicetak masih cara klasik untuk belajar.

Ya, sepenuhnya percuma, boleh dicari dalam pelayar anda dan boleh dicetak tanpa sebarang akaun.


Carian popular
vim cheat sheet vim commands list vim shortcuts vim search and replace vim motions reference vim visual mode commands vim macros how to quit vim
Perlukan bantuan?
Menemui masalah dengan alat ini? Beritahu pasukan kami.
Laporkan masalah

Tambah alat percuma ini ke laman web anda sendiri — salin dan tampal kod di bawah.