Gratis konverter

Vim kommandoer Snydeark

Omfattende Vim kommando snydeark. Søg i mere end 80 vigtige Vim-kommandoer med eksempler, beskrivelser og kopi med ét klik.

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

Om dette værktøj

En omfattende hurtig referencevejledning til vim-kommandoer. Gennemse almindeligt anvendte kommandoer, syntaks og eksempler organiseret efter kategori. Søgbar og mobilvenlig - bogmærk denne side for øjeblikkelig adgang, når du har brug for en hurtig påmindelse.

Sådan bruger du det

  1. Gennemse de kategoriserede referencesektioner.
  2. Brug søgelinjen til at finde bestemte kommandoer eller syntaks.
  3. Klik på en vilkårlig post for at se brugseksempler og forklaringer.
  4. Kopier kommandoer direkte til brug i din terminal eller editor.

Ofte stillede spørgsmål

Er denne reference opdateret?
Referencen dækker meget brugte kommandoer og syntaks, der er stabile på tværs af versioner. Se den officielle dokumentation for de seneste tilføjelser eller versionsspecifikke funktioner.
Kan jeg bruge dette offline?
Når den er indlæst, fungerer siden uden internetforbindelse. Bogmærk det for hurtig adgang - alt indhold gengives i browseren uden yderligere netværksanmodninger.
Er dette omfattende eller kun det grundlæggende?
Den dækker de mest almindeligt anvendte kommandoer og mønstre, der håndterer 90 % af hverdagens opgaver. Se den officielle dokumentation for niche- eller avancerede funktioner.
Kan jeg foreslå tilføjelser?
Vi opdaterer løbende vores referencer. Hvis du bemærker manglende kommandoer eller har forslag, så lad os det vide via vores kontaktside.