Tasuta konverter

Vimi käsud Petuleht

Põhjalik Vimi käskude petuleht. Otsige 80+ olulist Vimi käsku koos näidete, kirjelduste ja ühe klõpsuga koopiaga.

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

Sellest tööriistast

Põhjalik kiirjuhend vim-käskude jaoks. Sirvige sagedamini kasutatavaid käske, süntaksit ja näiteid kategooriate kaupa. Otsitav ja mobiilisõbralik – lisage see leht järjehoidjatesse, et pääseda kohe juurde, kui vajate kiiret meeldetuletust.

Kuidas kasutada

  1. Sirvige kategoriseeritud viiteosasid.
  2. Kasutage konkreetsete käskude või süntaksi leidmiseks otsinguriba.
  3. Kasutamisnäidete ja selgituste vaatamiseks klõpsake mis tahes kirjel.
  4. Kopeerige käsud otse terminalis või redaktoris kasutamiseks.

Korduma kippuvad küsimused

Kas see viide on ajakohane?
Viide hõlmab laialdaselt kasutatavaid käske ja süntaksit, mis on versioonide lõikes stabiilsed. Viimaste täienduste või versioonipõhiste funktsioonide vaatamiseks vaadake ametlikku dokumentatsiooni.
Kas ma saan seda võrguühenduseta kasutada?
Pärast laadimist töötab leht ilma Interneti-ühenduseta. Lisage see kiireks juurdepääsuks järjehoidjatesse – kogu sisu renderdatakse brauseris ilma täiendavate võrgupäringuteta.
Kas see on kõikehõlmav või ainult põhitõed?
See hõlmab kõige sagedamini kasutatavaid käske ja mustreid, mis täidavad 90% igapäevastest ülesannetest. Niši- või täiustatud funktsioonide kohta vaadake ametlikku dokumentatsiooni.
Kas ma saan soovitada täiendusi?
Uuendame regulaarselt oma viiteid. Kui märkate puuduvaid käske või teil on soovitusi, andke meile sellest meie kontaktide lehe kaudu teada.