Gratis converter

Vim-opdrachten Spiekbriefje

Uitgebreid Vim-opdrachtspiekbriefje. Doorzoek meer dan 80 essentiële Vim-opdrachten met voorbeelden, beschrijvingen en kopiëren met één klik.

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

Over deze tool

Een uitgebreide beknopte handleiding voor vim-opdrachten. Blader door veelgebruikte opdrachten, syntaxis en voorbeelden, geordend op categorie. Doorzoekbaar en mobielvriendelijk: maak een bladwijzer voor deze pagina voor directe toegang wanneer u een snelle herinnering nodig heeft.

Hoe te gebruiken

  1. Blader door de gecategoriseerde referentiesecties.
  2. Gebruik de zoekbalk om specifieke opdrachten of syntaxis te vinden.
  3. Klik op een item om gebruiksvoorbeelden en uitleg te zien.
  4. Kopieer opdrachten rechtstreeks voor gebruik in uw terminal of editor.

Veelgestelde vragen

Is deze referentie actueel?
De referentie behandelt veelgebruikte opdrachten en syntaxis die stabiel zijn in alle versies. Raadpleeg de officiële documentatie voor de nieuwste toevoegingen of versiespecifieke functies.
Kan ik dit offline gebruiken?
Eenmaal geladen werkt de pagina zonder internetverbinding. Maak er een bladwijzer van voor snelle toegang: alle inhoud wordt in de browser weergegeven zonder verdere netwerkverzoeken.
Is dit allesomvattend of alleen de basis?
Het behandelt de meest gebruikte opdrachten en patronen die 90% van de dagelijkse taken afhandelen. Raadpleeg de officiële documentatie voor niche- of geavanceerde functies.
Kan ik aanvullingen voorstellen?
Wij actualiseren regelmatig onze referenties. Als u ontbrekende opdrachten opmerkt of suggesties heeft, kunt u ons dit laten weten via onze contactpagina.