Convertisseur Gratuit

Commandes Vim Aide-mémoire

Aide-mémoire complet des commandes Vim. Recherchez plus de 80 commandes Vim essentielles avec exemples, descriptions et copie en un clic.

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

À propos de cet outil

Un guide de référence rapide complet pour les commandes vim. Parcourez les commandes, la syntaxe et les exemples couramment utilisés, organisés par catégorie. Consultable et adapté aux appareils mobiles : ajoutez cette page à vos favoris pour un accès instantané lorsque vous avez besoin d'un rappel rapide.

Comment l'utiliser

  1. Parcourez les sections de référence catégorisées.
  2. Utilisez la barre de recherche pour rechercher des commandes ou une syntaxe spécifiques.
  3. Cliquez sur n’importe quelle entrée pour voir des exemples d’utilisation et des explications.
  4. Copiez les commandes directement pour les utiliser dans votre terminal ou éditeur.

Questions fréquentes

Cette référence est-elle à jour ?
La référence couvre les commandes largement utilisées et la syntaxe stable d’une version à l’autre. Pour les derniers ajouts ou fonctionnalités spécifiques à la version, consultez la documentation officielle.
Puis-je l'utiliser hors ligne ?
Une fois chargée, la page fonctionne sans connexion Internet. Ajoutez-le à vos favoris pour un accès rapide : tout le contenu est affiché dans le navigateur sans autres requêtes réseau.
Est-ce complet ou juste les bases ?
Il couvre les commandes et les modèles les plus couramment utilisés qui gèrent 90 % des tâches quotidiennes. Pour des fonctionnalités de niche ou avancées, consultez la documentation officielle.
Puis-je suggérer des ajouts ?
Nous mettons régulièrement à jour nos références. Si vous remarquez des commandes manquantes ou avez des suggestions, faites-le nous savoir via notre page de contact.