Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 629 across 38 tools. Pick a tool in the sidebar, or search across all of them.
Showing Vim. Choose another tool in the sidebar, or search all 629 commands.
Vim
Survive and thrive in the editor that opens when you least expect it. Esc returns to normal mode.
| Command | What it does | Example |
|---|---|---|
:w | Save (write) the file. | :w |
:q | Quit. | :q |
:wq or ZZ | Save and quit. | :wq |
:q! | Quit and throw away changes. | :q! |
i / a | Insert before / after the cursor. | i |
Esc | Leave insert mode, back to normal mode. | Esc |
dd | Delete (cut) the current line. | dd |
yy / p | Copy the line / paste it below. | yy |
u / Ctrl-r | Undo / redo. | u |
/pattern | Search forward; press n for the next match. | /error |
:%s/old/new/g | Find and replace across the whole file. | :%s/foo/bar/g |
gg / G | Jump to the top / bottom of the file. | G |
0 / $ | Jump to the start / end of the line. | $ |
:N | Go to line number N. | :42 |
v / V | Start a character / whole-line selection. | V |
:set number | Show line numbers. | :set number |