Vim Cheat Sheet
Vim editor commands reference guide
Vim Cheat Sheet
Quick reference guide for Vim editor commands. Click the copy button to copy any command.
119
Total Commands
119
Filtered Results
Modes
Command | Copy | Description |
---|---|---|
i | Enter insert mode (before cursor) | |
a | Enter insert mode (after cursor) | |
I | Insert at beginning of line | |
A | Insert at end of line | |
o | Open new line below | |
O | Open new line above | |
Esc | Return to normal mode | |
v | Enter visual mode (character) | |
V | Enter visual mode (line) | |
Ctrl+v | Enter visual mode (block) | |
: | Enter command mode |
Navigation
Command | Copy | Description |
---|---|---|
h | Move left | |
j | Move down | |
k | Move up | |
l | Move right | |
w | Move to next word | |
b | Move to previous word | |
e | Move to end of word | |
0 | Move to start of line | |
$ | Move to end of line | |
^ | Move to first non-blank character | |
gg | Go to first line | |
G | Go to last line | |
5G | Go to line 5 | |
Ctrl+d | Scroll down half page | |
Ctrl+u | Scroll up half page | |
Ctrl+f | Scroll down full page | |
Ctrl+b | Scroll up full page | |
% | Jump to matching bracket |
Editing
Command | Copy | Description |
---|---|---|
x | Delete character under cursor | |
X | Delete character before cursor | |
dd | Delete current line | |
D | Delete from cursor to end of line | |
dw | Delete word | |
d$ | Delete to end of line | |
d0 | Delete to beginning of line | |
yy | Yank (copy) current line | |
yw | Yank word | |
y$ | Yank to end of line | |
p | Paste after cursor | |
P | Paste before cursor | |
u | Undo | |
Ctrl+r | Redo | |
r | Replace single character | |
R | Enter replace mode | |
cw | Change word | |
cc | Change entire line | |
C | Change to end of line | |
~ | Toggle case of character | |
. | Repeat last command |
Search and Replace
Command | Copy | Description |
---|---|---|
/pattern | Search forward for pattern | |
?pattern | Search backward for pattern | |
n | Repeat search forward | |
N | Repeat search backward | |
:s/old/new | Replace first occurrence in line | |
:s/old/new/g | Replace all in line | |
:%s/old/new/g | Replace all in file | |
:%s/old/new/gc | Replace all with confirmation | |
* | Search for word under cursor | |
# | Search backward for word under cursor |
File Operations
Command | Copy | Description |
---|---|---|
:w | Save file | |
:w filename | Save as filename | |
:q | Quit | |
:q! | Quit without saving | |
:wq | Save and quit | |
:x | Save and quit (same as :wq) | |
ZZ | Save and quit (normal mode) | |
ZQ | Quit without saving (normal mode) | |
:e filename | Open file | |
:r filename | Insert file contents | |
:saveas filename | Save as and switch to file |
Buffers
Command | Copy | Description |
---|---|---|
:bn | Next buffer | |
:bp | Previous buffer | |
:bd | Delete buffer | |
:ls | List all buffers | |
:b5 | Switch to buffer 5 |
Windows
Command | Copy | Description |
---|---|---|
:split | Split window horizontally | |
:vsplit | Split window vertically | |
Ctrl+w s | Split window horizontally | |
Ctrl+w v | Split window vertically | |
Ctrl+w w | Switch between windows | |
Ctrl+w h | Move to left window | |
Ctrl+w j | Move to window below | |
Ctrl+w k | Move to window above | |
Ctrl+w l | Move to right window | |
Ctrl+w q | Close current window | |
Ctrl+w = | Make all windows equal size |
Tabs
Command | Copy | Description |
---|---|---|
:tabnew | Create new tab | |
:tabnew filename | Open file in new tab | |
gt | Go to next tab | |
gT | Go to previous tab | |
:tabc | Close current tab | |
:tabo | Close all other tabs |
Visual Mode
Command | Copy | Description |
---|---|---|
> | Indent selected text | |
< | Unindent selected text | |
d | Delete selected text | |
y | Yank selected text | |
c | Change selected text |
Marks
Command | Copy | Description |
---|---|---|
ma | Set mark a | |
'a | Jump to mark a | |
:marks | List all marks |
Macros
Command | Copy | Description |
---|---|---|
qa | Record macro in register a | |
q | Stop recording macro | |
@a | Execute macro a | |
@@ | Repeat last macro |
Text Objects
Command | Copy | Description |
---|---|---|
diw | Delete inner word | |
daw | Delete a word (with space) | |
di" | Delete inside quotes | |
da" | Delete around quotes | |
dip | Delete inner paragraph | |
ci{ | Change inside curly braces |
Other Useful Commands
Command | Copy | Description |
---|---|---|
:set number | Show line numbers | |
:set nonumber | Hide line numbers | |
:set paste | Enable paste mode | |
:set nopaste | Disable paste mode | |
:syntax on | Enable syntax highlighting | |
:!command | Execute shell command | |
J | Join line below to current line | |
gJ | Join without adding space |
All operations are performed locally in your browser. No data is sent to any server.
About Vim Cheat Sheet
This section will contain detailed, SEO-friendly content about the Vim Cheat Sheet.
In the future, this content will be managed through a headless CMS, allowing you to:
- Add detailed explanations about how to use this tool
- Include examples and use cases
- Provide tips and best practices
- Add FAQs and troubleshooting guides
- Update content without touching the code
How to Use
Step-by-step instructions for using the Vim Cheat Sheet will appear here. This content will be fully customizable through the admin panel.
Features
Key features and benefits of this tool will be listed here. All content is editable via the CMS.