Ingyenes konverter

Vim parancsok Cheat Sheet

Átfogó Vim parancs csalólap. Keressen 80+ alapvető Vim-parancsban példákkal, leírásokkal és egy kattintásos másolattal.

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

Az eszközről

Átfogó gyorsreferencia útmutató a vim parancsokhoz. Böngésszen a gyakran használt parancsok, szintaxis és példák között kategóriák szerint rendezve. Kereshető és mobilbarát – vegye fel ezt az oldalt a könyvjelzők közé, hogy azonnal hozzáférhessen, ha gyors emlékeztetőre van szüksége.

Használati útmutató

  1. Böngésszen a kategorizált referenciarészek között.
  2. A keresősáv segítségével konkrét parancsokat vagy szintaxist kereshet.
  3. Kattintson bármelyik bejegyzésre a használati példák és magyarázatok megtekintéséhez.
  4. Másolja a parancsokat közvetlenül a terminálban vagy a szerkesztőben való használatra.

Gyakran ismételt kérdések

Ez a hivatkozás naprakész?
A hivatkozás kiterjed a széles körben használt parancsokra és szintaxisra, amelyek változatok között stabilak. A legújabb kiegészítésekért vagy verzióspecifikus szolgáltatásokért tekintse meg a hivatalos dokumentációt.
Használhatom ezt offline módban?
Betöltés után az oldal internetkapcsolat nélkül is működik. Vegye fel a könyvjelzők közé a gyors eléréshez – minden tartalom a böngészőben jelenik meg további hálózati kérések nélkül.
Ez átfogó vagy csak az alapok?
Lefedi a leggyakrabban használt parancsokat és mintákat, amelyek a mindennapi feladatok 90%-át kezelik. A rést vagy speciális funkciókat a hivatalos dokumentációban találja.
Javasolhatok kiegészítéseket?
Referenciáinkat rendszeresen frissítjük. Ha hiányzó parancsokat észlel, vagy javaslatai vannak, tudassa velünk kapcsolatfelvételi oldalunkon keresztül.