مبدل رایگان

دستورات Vim برگه تقلب

برگه تقلب دستورات Vim جامع. بیش از 80 دستور ضروری Vim را با مثال، توضیحات و کپی با یک کلیک جستجو کنید.

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٪ از کارهای روزمره را انجام می دهد. برای ویژگی های خاص یا پیشرفته، به اسناد رسمی مراجعه کنید.
آیا می توانم اضافات را پیشنهاد کنم؟
ما به طور مرتب مراجع خود را به روز می کنیم. اگر متوجه شدید دستورات از دست رفته یا پیشنهادی دارید، از طریق صفحه تماس با ما به ما اطلاع دهید.