Zdarma převodník

Příkazy Vim Cheat Sheet

Komplexní cheat pro příkaz Vim. Prohledávejte 80+ základních příkazů Vim s příklady, popisy a kopírováním na jedno kliknutí.

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

O tomto nástroji

Komplexní rychlá referenční příručka pro příkazy vim. Procházejte běžně používané příkazy, syntaxi a příklady uspořádané podle kategorií. Prohledávatelné a vhodné pro mobily – přidejte si tuto stránku do záložek, abyste k ní měli okamžitý přístup, když potřebujete rychlé připomenutí.

Jak používat

  1. Procházejte kategorizované referenční sekce.
  2. Pomocí vyhledávacího pole vyhledejte konkrétní příkazy nebo syntaxi.
  3. Kliknutím na libovolnou položku zobrazíte příklady použití a vysvětlení.
  4. Zkopírujte příkazy přímo pro použití ve vašem terminálu nebo editoru.

Často kladené dotazy

Je tato reference aktuální?
Odkaz pokrývá široce používané příkazy a syntaxi, které jsou stabilní napříč verzemi. Nejnovější přírůstky nebo funkce specifické pro verzi naleznete v oficiální dokumentaci.
Mohu to použít offline?
Po načtení stránka funguje bez připojení k internetu. Uložte si jej do záložek pro rychlý přístup – veškerý obsah se vykresluje v prohlížeči bez dalších síťových požadavků.
Je to komplexní nebo jen základní?
Pokrývá nejčastěji používané příkazy a vzory, které zvládají 90 % každodenních úkolů. Pro specializované nebo pokročilé funkce nahlédněte do oficiální dokumentace.
Mohu navrhnout doplňky?
Naše reference pravidelně aktualizujeme. Pokud si všimnete chybějících příkazů nebo máte návrhy, dejte nám vědět prostřednictvím naší kontaktní stránky.