Vim Shortcuts Cheat Sheet
1. Quick Reference The following table lists the most common Vim shortcuts: | Shortcut | Action | | --- | --- | | h, j, k, l | Move left, down, up, right | | w, b | Move forward, backward ...
TechSilo
AI-assisted and human-curated
1. **Quick Reference**
The following table lists the most common Vim shortcuts:
| Shortcut | Action |
| --- | --- |
| h, j, k, l | Move left, down, up, right |
| w, b | Move forward, backward one word |
| 0, $ | Move to start, end of line |
| gg, G | Move to start, end of file |
| i | Enter insert mode |
| esc | Exit insert mode |
| x | Delete character under cursor |
| dw | Delete word under cursor |
| dd | Delete line under cursor |
| p | Paste after cursor |
| u | Undo last action |
| Ctrl + r | Redo last action |
2. **Syntax**
Vim syntax uses the following placeholders:
* ^ matches start of line
* $ matches end of line
* . matches any single character
matches zero or more of the preceding element
* # matches the whole line
Example: :s/^/#/g adds # to the start of every line.
3. **Common Patterns**
Here are some copy-paste templates:
* Delete all lines containing a pattern: :g/pattern/d
* Replace all occurrences of a pattern: :s/pattern/replacement/g
* Copy a line: yy then p to paste
* Move a line: dd then p to paste
4. **Gotchas**
* Not in insert mode: If you're trying to type but nothing is happening, make sure you're in insert mode by pressing i.
* Not saving changes: If you're trying to save but Vim is complaining, make sure you have write permissions and use :w! to override.
* Vim not responding: If Vim is frozen, try pressing Ctrl + c to interrupt the current command.
5. **Related Commands**
Some useful Vim plugins and commands to use with these shortcuts:
* NERDTree: a file explorer plugin, use :NERDTreeToggle to toggle
* Syntastic: a syntax checker plugin, use :SyntasticCheck to check syntax
* Vim-airline: a status bar plugin, use :AirlineTheme to change theme
* Vim-fugitive: a Git plugin, use :Gstatus to view Git status
Want to put this into practice?
Explore TechSilo's free developer tools for practical utilities you can use directly in your browser.
Related blog posts
CSS Flexbox Cheat Sheet: Alignment, Wrapping, and Responsive Rows
A practical CSS Flexbox reference covering display:flex, flex-direction, gap, justify-content, align-items, flex-wrap, and flex shorthand.
Read postCSS Grid Cheat Sheet: Columns, Rows, Areas, and Responsive Layouts
A practical CSS Grid reference with repeat(), minmax(), auto-fit, alignment, named areas, and responsive layout examples.
Read postnpm Scripts Cheat Sheet: Commands, Arguments, and Automation
A developer reference for package.json scripts, npm run, pre/post hooks, environment variables, and safe task automation.
Read postTypeScript Utility Types Cheat Sheet: Pick, Omit, Partial and More
Practical examples of TypeScript Partial, Required, Pick, Omit, Record, ReturnType, Awaited, Extract, and Exclude.
Read postGit Commands Cheat Sheet
1. Quick Reference | Command | Description | | --- | --- | | git init | Initialize a new Git repository | | git clone [url] | Clone a Git repository from a URL | | git add [file] | Stage a file ...
Read post