Vim Keyboard Shortcuts
95+ Vim shortcuts for modes, movement, editing, search, and macros. Essential reference for terminal users.
Modes
| Action | Shortcut |
|---|---|
| Enter Insert mode (before cursor) | |
| Enter Insert mode (beginning of line) | |
| Enter Insert mode (after cursor) | |
| Enter Insert mode (end of line) | |
| Open new line below and enter Insert mode | |
| Open new line above and enter Insert mode | |
| Return to Normal mode | |
| Enter Visual mode (character) | |
| Enter Visual mode (line) | |
| Enter Visual Block mode | |
| Enter Command-line mode | |
| Enter Replace mode |
Movement
| Action | Shortcut |
|---|---|
| Move left / down / up / right | |
| Jump to next word start | |
| Jump to next WORD start (space-separated) | |
| Jump to previous word start | |
| Jump to previous WORD start | |
| Jump to end of word | |
| Jump to end of WORD | |
| Jump to beginning of line | |
| Jump to first non-blank character | |
| Jump to end of line | |
| Jump to first line | |
| Jump to last line | |
| Jump to line number | |
| Jump to previous paragraph | |
| Jump to next paragraph | |
| Jump to matching bracket | |
| Jump to top / middle / bottom of screen | |
| Scroll half page up | |
| Scroll half page down | |
| Scroll full page up | |
| Scroll full page down | |
| Find next character on line | |
| Find previous character on line | |
| Jump to before next character | |
| Repeat last f/F/t/T motion |
Editing
| Action | Shortcut |
|---|---|
| Delete character under cursor | |
| Delete character before cursor | |
| Delete (cut) entire line | |
| Delete word from cursor | |
| Delete to end of line | |
| Delete to beginning of line | |
| Change (delete + insert) entire line | |
| Change word from cursor | |
| Change to end of line | |
| Replace single character | |
| Delete character and enter Insert mode | |
| Delete line and enter Insert mode | |
| Join line below to current line | |
| Undo | |
| Redo | |
| Repeat last command | |
| Toggle case of character | |
| Indent line | |
| Unindent line |
Yank & Put
| Action | Shortcut |
|---|---|
| Yank (copy) entire line | |
| Yank word | |
| Yank to end of line | |
| Put (paste) after cursor | |
| Put (paste) before cursor | |
| Yank to named register | |
| Paste from named register |
Search
| Action | Shortcut |
|---|---|
| Search forward | |
| Search backward | |
| Next search match | |
| Previous search match | |
| Search forward for word under cursor | |
| Search backward for word under cursor | |
| Replace all in file | |
| Replace all with confirmations |
Files
| Action | Shortcut |
|---|---|
| Save file | |
| Quit | |
| Save and quit | |
| Quit without saving | |
| Open file | |
| Next / previous buffer | |
| List open buffers | |
| Close buffer |
Windows
| Action | Shortcut |
|---|---|
| Horizontal split | |
| Vertical split | |
| Navigate between splits | |
| Equal size splits | |
| Close split | |
| New tab | |
| Next / previous tab |
Marks
| Action | Shortcut |
|---|---|
| Set mark | |
| Jump to mark (line) | |
| Jump to mark (exact position) | |
| Jump to older position | |
| Jump to newer position |
Macros
| Action | Shortcut |
|---|---|
| Start recording macro to register | |
| Stop recording macro | |
| Execute macro from register | |
| Repeat last macro |
Pro tips
Start with vimtutor
Run 'vimtutor' in your terminal for a 30-minute interactive tutorial. It covers all the basics. After that, learn 2-3 new commands per week instead of trying to memorize everything at once.
Frequently asked questions
How do I exit Vim?
Type :q to quit (if no changes). :q! to quit without saving. :wq or ZZ to save and quit. :x also saves and quits. If you're stuck in Insert mode, press Esc first to return to Normal mode.
What's the difference between Vim and Neovim?
Neovim is a modernized fork of Vim with better defaults, built-in LSP support, Lua scripting, and async plugin architecture. Most Vim shortcuts work identically in Neovim. Neovim is recommended for new users.
Should I use Vim or a Vim extension in my editor?
Both are valid. VS Code's Vim extension (vscodevim) and JetBrains IdeaVim give you Vim keybindings in a familiar IDE. Full Vim/Neovim offers more power but a steeper learning curve.
How do I configure Vim?
Edit ~/.vimrc (Vim) or ~/.config/nvim/init.vim (Neovim). Common settings: set number (line numbers), set relativenumber, set tabstop=2, set expandtab, set hlsearch, syntax on.
What are the most important commands to learn first?
Start with: i/Esc (insert/normal mode), h/j/k/l (movement), dd (delete line), yy/p (copy/paste), u (undo), :w/:q (save/quit), / (search), and . (repeat). These cover 80% of daily editing.
How do I copy to the system clipboard?
Use "+y to yank to the system clipboard and "+p to paste from it. Make sure your Vim is compiled with +clipboard support (check with vim --version). In Neovim, set clipboard=unnamedplus in your config.
Want to master Vim?
Go beyond shortcuts with in-depth Vim video courses, from the basics all the way to advanced workflows.
Explore Vim courses