Bezplatný prevodník

Príkazy Vim Cheat Sheet

Komplexný cheat na príkaz Vim. Vyhľadajte viac ako 80 základných príkazov Vim s príkladmi, popismi a kopírovaním na jedno kliknutie.

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

O tomto nástroji

Komplexná rýchla referenčná príručka pre príkazy vim. Prehľadávajte bežne používané príkazy, syntax a príklady usporiadané podľa kategórií. Vyhľadávateľná a vhodná pre mobilné zariadenia – označte túto stránku záložkou, aby ste k nej mali okamžitý prístup, keď potrebujete rýchlu pripomienku.

Ako používať

  1. Prezrite si kategorizované referenčné sekcie.
  2. Pomocou vyhľadávacieho panela vyhľadajte konkrétne príkazy alebo syntax.
  3. Kliknutím na ľubovoľný záznam zobrazíte príklady použitia a vysvetlenia.
  4. Skopírujte príkazy priamo na použitie vo vašom termináli alebo editore.

Často kladené otázky

Je táto referencia aktuálna?
Odkaz pokrýva široko používané príkazy a syntax, ktoré sú stabilné vo všetkých verziách. Najnovšie doplnky alebo funkcie špecifické pre verziu nájdete v oficiálnej dokumentácii.
Môžem to použiť offline?
Po načítaní stránka funguje bez internetového pripojenia. Uložte si ho ako záložku pre rýchly prístup – všetok obsah sa vykreslí v prehliadači bez ďalších sieťových požiadaviek.
Je to komplexné alebo len základy?
Pokrýva najčastejšie používané príkazy a vzory, ktoré zvládajú 90 % každodenných úloh. Špeciálne alebo pokročilé funkcie nájdete v oficiálnej dokumentácii.
Môžem navrhnúť doplnky?
Naše referencie pravidelne aktualizujeme. Ak si všimnete chýbajúce príkazy alebo máte návrhy, dajte nám vedieť prostredníctvom našej kontaktnej stránky.