Conversor Gratuito

Comandos Vim Folha de Dicas

Folha de dicas completa de comandos Vim. Pesquise mais de 80 comandos Vim essenciais com exemplos, descrições e cópia com um clique.

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

Sobre esta ferramenta

Um guia de referência rápida abrangente para comandos do vim. Procure comandos, sintaxe e exemplos comumente usados, organizados por categoria. Pesquisável e compatível com dispositivos móveis – marque esta página para acesso instantâneo quando precisar de um lembrete rápido.

Como usar

  1. Navegue pelas seções de referência categorizadas.
  2. Use a barra de pesquisa para encontrar comandos ou sintaxe específicos.
  3. Clique em qualquer entrada para ver exemplos de uso e explicações.
  4. Copie comandos diretamente para uso em seu terminal ou editor.

Perguntas frequentes

Esta referência está atualizada?
A referência abrange comandos e sintaxe amplamente utilizados que são estáveis entre versões. Para as últimas adições ou recursos específicos da versão, verifique a documentação oficial.
Posso usar isso off-line?
Depois de carregada, a página funciona sem conexão com a internet. Adicione-o aos favoritos para acesso rápido – todo o conteúdo é renderizado no navegador sem mais solicitações de rede.
Isso é abrangente ou apenas o básico?
Abrange os comandos e padrões mais comumente usados que lidam com 90% das tarefas diárias. Para recursos de nicho ou avançados, consulte a documentação oficial.
Posso sugerir acréscimos?
Atualizamos regularmente as nossas referências. Se você notar comandos ausentes ou tiver sugestões, avise-nos através de nossa página de contato.