Brezplačni pretvornik

Ukazi Vim Cheat Sheet

Obsežen goljuf za ukaze Vim. Preiščite 80+ bistvenih ukazov Vim s primeri, opisi in kopijo z enim klikom.

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

O tem orodju

Obsežen hitri vodnik za ukaze vim. Prebrskajte po pogosto uporabljenih ukazih, sintaksi in primerih, razvrščenih po kategorijah. Možnost iskanja in prijazna do mobilnih naprav – dodajte to stran med zaznamke za takojšen dostop, ko potrebujete hiter opomnik.

Kako uporabljati

  1. Brskajte po kategoriziranih referenčnih razdelkih.
  2. Z iskalno vrstico poiščite določene ukaze ali sintakso.
  3. Kliknite kateri koli vnos, če si želite ogledati primere uporabe in razlage.
  4. Kopirajte ukaze neposredno za uporabo v terminalu ali urejevalniku.

Pogosta vprašanja

Ali je ta referenca posodobljena?
Referenca pokriva pogosto uporabljene ukaze in sintakso, ki so stabilne med različicami. Za najnovejše dodatke ali funkcije, specifične za različico, preverite uradno dokumentacijo.
Ali lahko to uporabljam brez povezave?
Ko se stran naloži, deluje brez internetne povezave. Dodajte ga med zaznamke za hiter dostop — vsa vsebina je upodobljena v brskalniku brez nadaljnjih omrežnih zahtev.
Je to celovito ali le osnove?
Zajema najpogosteje uporabljene ukaze in vzorce, ki obravnavajo 90 % vsakodnevnih opravil. Za nišne ali napredne funkcije si oglejte uradno dokumentacijo.
Lahko predlagam dodatke?
Naše reference redno posodabljamo. Če opazite manjkajoče ukaze ali imate predloge, nam to sporočite prek naše kontaktne strani.