Безкоштовний конвертер

Команди 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% повсякденних завдань. Щоб дізнатися про спеціальну або розширену функцію, зверніться до офіційної документації.
Чи можу я запропонувати доповнення?
Ми регулярно оновлюємо наші посилання. Якщо ви помітили відсутні команди або маєте пропозиції, повідомте нам про це через нашу сторінку контактів.