แปลงฟรี

คำสั่งเป็นกลุ่ม แผ่นโกง

แผ่นโกงคำสั่ง Vim ที่ครอบคลุม ค้นหาคำสั่ง Vim ที่จำเป็นมากกว่า 80 รายการพร้อมตัวอย่าง คำอธิบาย และการคัดลอกในคลิกเดียว

i
Enter Insert mode before the cursor
ตัวอย่าง:i
I
Enter Insert mode at the beginning of the line
ตัวอย่าง:I
a
Enter Insert mode after the cursor
ตัวอย่าง:a
A
Enter Insert mode at the end of the line
ตัวอย่าง:A
o
Open a new line below and enter Insert mode
ตัวอย่าง:o
O
Open a new line above and enter Insert mode
ตัวอย่าง:O
v
Enter Visual mode (character selection)
ตัวอย่าง:v
V
Enter Visual Line mode (line selection)
ตัวอย่าง:V
Ctrl+v
Enter Visual Block mode (column selection)
ตัวอย่าง:Ctrl+v
:
Enter Command-line mode
ตัวอย่าง::w
Esc
Return to Normal mode from any mode
ตัวอย่าง:Esc
R
Enter Replace mode (overwrite characters)
ตัวอย่าง:R
h
Move cursor left
ตัวอย่าง:5h
j
Move cursor down
ตัวอย่าง:10j
k
Move cursor up
ตัวอย่าง:10k
l
Move cursor right
ตัวอย่าง:5l
w
Move to the start of the next word
ตัวอย่าง:3w
b
Move to the start of the previous word
ตัวอย่าง:3b
e
Move to the end of the current word
ตัวอย่าง:2e
0
Move to the beginning of the line
ตัวอย่าง:0
^
Move to the first non-blank character of the line
ตัวอย่าง:^
$
Move to the end of the line
ตัวอย่าง:$
gg
Move to the first line of the file
ตัวอย่าง:gg
G
Move to the last line of the file
ตัวอย่าง:G
:N
Jump to line number N
ตัวอย่าง::42
Ctrl+f
Scroll forward (down) one screen
ตัวอย่าง:Ctrl+f
Ctrl+b
Scroll backward (up) one screen
ตัวอย่าง:Ctrl+b
Ctrl+d
Scroll down half a screen
ตัวอย่าง:Ctrl+d
Ctrl+u
Scroll up half a screen
ตัวอย่าง:Ctrl+u
H
Move cursor to the top of the screen
ตัวอย่าง:H
M
Move cursor to the middle of the screen
ตัวอย่าง:M
L
Move cursor to the bottom of the screen
ตัวอย่าง:L
%
Jump to matching bracket, parenthesis, or brace
ตัวอย่าง:%
x
Delete the character under the cursor
ตัวอย่าง:x
dd
Delete (cut) the current line
ตัวอย่าง:dd
dw
Delete from cursor to the end of the word
ตัวอย่าง:dw
d$
Delete from cursor to the end of the line
ตัวอย่าง:d$
D
Delete from cursor to end of line (same as d$)
ตัวอย่าง:D
yy
Yank (copy) the current line
ตัวอย่าง:yy
yw
Yank (copy) from cursor to end of word
ตัวอย่าง:yw
p
Paste after the cursor
ตัวอย่าง:p
P
Paste before the cursor
ตัวอย่าง:P
u
Undo the last change
ตัวอย่าง:u
Ctrl+r
Redo the last undone change
ตัวอย่าง:Ctrl+r
cc
Change (delete and enter insert mode) the current line
ตัวอย่าง:cc
cw
Change from cursor to end of word
ตัวอย่าง:cw
c$
Change from cursor to end of line
ตัวอย่าง:c$
.
Repeat the last change
ตัวอย่าง:.
>>
Indent the current line one level to the right
ตัวอย่าง:>>
<<
Unindent the current line one level to the left
ตัวอย่าง:<<
==
Auto-indent the current line
ตัวอย่าง:==
J
Join the current line with the line below
ตัวอย่าง:J
~
Toggle case of character under cursor
ตัวอย่าง:~
r{char}
Replace the character under the cursor with {char}
ตัวอย่าง:ra
/{pattern}
Search forward for pattern
ตัวอย่าง:/foo
?{pattern}
Search backward for pattern
ตัวอย่าง:?foo
n
Repeat the last search in the same direction
ตัวอย่าง:n
N
Repeat the last search in the opposite direction
ตัวอย่าง:N
*
Search forward for the word under the cursor
ตัวอย่าง:*
#
Search backward for the word under the cursor
ตัวอย่าง:#
:s/old/new/g
Replace all occurrences of old with new on the current line
ตัวอย่าง::s/foo/bar/g
:%s/old/new/g
Replace all occurrences of old with new in the whole file
ตัวอย่าง::%s/foo/bar/g
:%s/old/new/gc
Replace all with confirmation prompts
ตัวอย่าง::%s/foo/bar/gc
:noh
Clear the search highlight
ตัวอย่าง::noh
:w
Save the current file
ตัวอย่าง::w
:w filename
Save the current buffer as a new filename
ตัวอย่าง::w newfile.txt
:q
Quit (close the window)
ตัวอย่าง::q
:wq
Save and quit
ตัวอย่าง::wq
:q!
Quit without saving (force quit)
ตัวอย่าง::q!
:x
Save and quit (only writes if changes were made)
ตัวอย่าง::x
:e filename
Open a file for editing
ตัวอย่าง::e README.md
:sp
Split the window horizontally
ตัวอย่าง::sp file.txt
:vsp
Split the window vertically
ตัวอย่าง::vsp file.txt
Ctrl+w+w
Switch focus to the next split window
ตัวอย่าง:Ctrl+w w
Ctrl+w+h/j/k/l
Move focus to the window in the given direction
ตัวอย่าง:Ctrl+w l
:close
Close the current window split
ตัวอย่าง::close
:only
Close all windows except the current one
ตัวอย่าง::only
:bn
Switch to the next buffer
ตัวอย่าง::bn
:bp
Switch to the previous buffer
ตัวอย่าง::bp
:bd
Delete (close) the current buffer
ตัวอย่าง::bd
:ls
List all open buffers
ตัวอย่าง::ls
:b N
Switch to buffer number N
ตัวอย่าง::b 2
:tabnew
Open a new tab
ตัวอย่าง::tabnew file.txt
:tabn
Switch to the next tab
ตัวอย่าง::tabn
:tabp
Switch to the previous tab
ตัวอย่าง::tabp
:tabclose
Close the current tab
ตัวอย่าง::tabclose
gt
Go to the next tab
ตัวอย่าง:gt
gT
Go to the previous tab
ตัวอย่าง:gT
q{a-z}
Start recording a macro into register {a-z}
ตัวอย่าง:qq
q (stop)
Stop recording the current macro
ตัวอย่าง:q
@{a-z}
Execute the macro stored in register {a-z}
ตัวอย่าง:@q
@@
Repeat the last executed macro
ตัวอย่าง:@@
N@{a-z}
Execute macro N times
ตัวอย่าง:5@q
:reg
Show the contents of all registers
ตัวอย่าง::reg
v then d
Select text in Visual mode then delete it
ตัวอย่าง:vwd
v then y
Select text in Visual mode then yank (copy) it
ตัวอย่าง:vwy
v then c
Select text in Visual mode then change it
ตัวอย่าง:vwc
v then >
Indent selected text to the right
ตัวอย่าง:vip>
vip
Select the current paragraph in Visual mode
ตัวอย่าง:vip
viw
Select the current word in Visual mode
ตัวอย่าง:viw
vis
Select the current sentence in Visual mode
ตัวอย่าง:vis
V then J
Select lines in Visual Line mode then join them
ตัวอย่าง:VjJ
:set number
Show line numbers
ตัวอย่าง::set number
:set nonumber
Hide line numbers
ตัวอย่าง::set nonumber
:syntax on
Enable syntax highlighting
ตัวอย่าง::syntax on
:colorscheme
Change the color scheme
ตัวอย่าง::colorscheme desert
:help {topic}
Open Vim help for a topic
ตัวอย่าง::help :w
m{a-z}
Set a mark at the current cursor position
ตัวอย่าง:ma
'{a-z}
Jump to the line of a mark
ตัวอย่าง:'a
`{a-z}
Jump to the exact position of a mark
ตัวอย่าง:`a
:set paste
Enable paste mode to avoid auto-indent issues
ตัวอย่าง::set paste
:set ignorecase
Make searches case-insensitive
ตัวอย่าง::set ignorecase
:set hlsearch
Highlight all search matches
ตัวอย่าง::set hlsearch
ga
Show the ASCII value of the character under the cursor
ตัวอย่าง:ga
zz
Center the current line on the screen
ตัวอย่าง:zz
Ctrl+g
Show the current file name and cursor position
ตัวอย่าง:Ctrl+g

เกี่ยวกับเครื่องมือนี้

คู่มืออ้างอิงฉบับย่อที่ครอบคลุมสำหรับคำสั่ง vim เรียกดูคำสั่ง ไวยากรณ์ และตัวอย่างที่ใช้กันทั่วไปโดยจัดเรียงตามหมวดหมู่ ค้นหาได้และเหมาะกับมือถือ — บุ๊กมาร์กหน้านี้เพื่อการเข้าถึงได้ทันทีเมื่อคุณต้องการการแจ้งเตือนอย่างรวดเร็ว

วิธีใช้งาน

  1. เรียกดูส่วนอ้างอิงที่จัดหมวดหมู่
  2. ใช้แถบค้นหาเพื่อค้นหาคำสั่งหรือไวยากรณ์เฉพาะ
  3. คลิกที่รายการใดๆ เพื่อดูตัวอย่างการใช้งานและคำอธิบาย
  4. คัดลอกคำสั่งโดยตรงเพื่อใช้ในเทอร์มินัลหรือโปรแกรมแก้ไขของคุณ

คำถามที่พบบ่อย

การอ้างอิงนี้เป็นข้อมูลล่าสุดหรือไม่
ข้อมูลอ้างอิงครอบคลุมคำสั่งและไวยากรณ์ที่ใช้กันอย่างแพร่หลายซึ่งมีความเสถียรในเวอร์ชันต่างๆ หากต้องการทราบคุณสมบัติเพิ่มเติมหรือคุณลักษณะเฉพาะเวอร์ชันล่าสุด โปรดตรวจสอบเอกสารประกอบอย่างเป็นทางการ
ฉันสามารถใช้แบบออฟไลน์ได้หรือไม่?
เมื่อโหลดแล้ว หน้าเว็บจะทำงานได้โดยไม่ต้องเชื่อมต่ออินเทอร์เน็ต บุ๊กมาร์กไว้เพื่อการเข้าถึงที่รวดเร็ว — เนื้อหาทั้งหมดแสดงผลในเบราว์เซอร์โดยไม่ต้องร้องขอเครือข่ายเพิ่มเติม
เรื่องนี้ครอบคลุมหรือแค่พื้นฐาน?
ครอบคลุมคำสั่งและรูปแบบที่ใช้บ่อยที่สุดซึ่งจัดการ 90% ของงานประจำวัน สำหรับคุณสมบัติเฉพาะหรือขั้นสูง โปรดดูเอกสารอย่างเป็นทางการ
ฉันสามารถแนะนำเพิ่มเติมได้หรือไม่?
เราอัปเดตข้อมูลอ้างอิงของเราเป็นประจำ หากคุณสังเกตเห็นคำสั่งที่หายไปหรือมีข้อเสนอแนะ โปรดแจ้งให้เราทราบผ่านหน้าติดต่อของเรา