Convertitore gratuito

Comandi Vim Foglio informativo

Foglio informativo completo sui comandi Vim. Cerca oltre 80 comandi Vim essenziali con esempi, descrizioni e copia con un clic.

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

Informazioni su questo strumento

Una guida di riferimento rapido completa per i comandi vim. Sfoglia comandi, sintassi ed esempi di uso comune organizzati per categoria. Ricercabile e ottimizzata per i dispositivi mobili: aggiungi questa pagina ai segnalibri per un accesso immediato quando hai bisogno di un promemoria rapido.

Come usarlo

  1. Sfoglia le sezioni di riferimento categorizzate.
  2. Utilizza la barra di ricerca per trovare comandi o sintassi specifici.
  3. Fare clic su qualsiasi voce per visualizzare esempi di utilizzo e spiegazioni.
  4. Copia i comandi direttamente per utilizzarli nel tuo terminale o editor.

Domande frequenti

Questo riferimento è aggiornato?
Il riferimento copre comandi e sintassi ampiamente utilizzati che sono stabili tra le versioni. Per le ultime aggiunte o funzionalità specifiche della versione, controlla la documentazione ufficiale.
Posso usarlo offline?
Una volta caricata, la pagina funziona senza connessione Internet. Aggiungilo ai segnalibri per un accesso rapido: tutto il contenuto viene visualizzato nel browser senza ulteriori richieste di rete.
È completo o solo le nozioni di base?
Copre i comandi e i modelli più comunemente utilizzati che gestiscono il 90% delle attività quotidiane. Per funzionalità di nicchia o avanzate consultare la documentazione ufficiale.
Posso suggerire delle integrazioni?
Aggiorniamo regolarmente le nostre referenze. Se noti comandi mancanti o hai suggerimenti, faccelo sapere tramite la nostra pagina dei contatti.