Convertidor Gratuito

Comandos Vim Hoja de Trucos

Hoja de trucos completa de comandos Vim. Busca más de 80 comandos esenciales de Vim con ejemplos, descripciones y copia con un clic.

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

Acerca de esta herramienta

Una guía completa de referencia rápida para los comandos vim. Explore los comandos, la sintaxis y los ejemplos más utilizados organizados por categoría. Con capacidad de búsqueda y compatible con dispositivos móviles: agregue esta página a sus favoritos para obtener acceso instantáneo cuando necesite un recordatorio rápido.

Cómo usarla

  1. Explore las secciones de referencia categorizadas.
  2. Utilice la barra de búsqueda para encontrar comandos o sintaxis específicos.
  3. Haga clic en cualquier entrada para ver ejemplos de uso y explicaciones.
  4. Copie comandos directamente para usarlos en su terminal o editor.

Preguntas frecuentes

¿Esta referencia está actualizada?
La referencia cubre comandos y sintaxis ampliamente utilizados que son estables en todas las versiones. Para conocer las últimas incorporaciones o funciones específicas de la versión, consulte la documentación oficial.
¿Puedo usar esto sin conexión?
Una vez cargada, la página funciona sin conexión a Internet. Márquelo como favorito para un acceso rápido: todo el contenido se muestra en el navegador sin más solicitudes de red.
¿Es esto completo o sólo lo básico?
Cubre los comandos y patrones más utilizados que manejan el 90% de las tareas diarias. Para funciones específicas o avanzadas, consulte la documentación oficial.
¿Puedo sugerir adiciones?
Actualizamos periódicamente nuestras referencias. Si nota que faltan comandos o tiene sugerencias, háganoslo saber a través de nuestra página de contacto.