Vim keyboard shortcuts
Vim is a language of motions, operators, and modes rather than a list of isolated hotkeys. Start with movement, combine it with editing, then use visual selection and window or file commands.
Vim is easier when you stop treating every key as a separate trick. Learn movement first, combine it with operators, and only then add visual selection, search, and file or window commands.
Motions
Move by character, word, sentence, paragraph, line, or matching delimiter in normal mode.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Next word start | w | w | w |
| Previous word start | b | b | b |
| Next word end | e | e | e |
| First non-blank of the line | ^ | ^ | ^ |
| End of the line | $ | $ | $ |
| Start of the file | gg | gg | gg |
| End of the file | G | G | G |
| Previous paragraph boundary} moves to the next one. | { | { | { |
| Jump to matching bracket or paren | % | % | % |
| Jump to next occurrence of a characterType f then the character. t jumps to just before it; F and T search backwards. | f | f | f |
Editing
Combine operators with motions, change text, copy and paste, undo, and repeat edits.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Delete the line | dd | dd | dd |
| Copy (yank) the line | yy | yy | yy |
| Paste after the cursorP pastes before. | p | p | p |
| Delete the character under the cursor | x | x | x |
| Undo | u | u | u |
| Redo | Ctrlr | Ctrlr | Ctrlr |
| Open a new line belowO opens above. | o | o | o |
| Change the whole word under the cursorThe ci text-object pattern works with other objects: ci( changes inside parentheses. | ciw | ciw | ciw |
| Change the whole line | cc | cc | cc |
| Repeat the last change | . | . | . |
Visual mode and search
Select text, search the buffer, move through matches, and replace what you find.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Start character-wise visual mode | v | v | v |
| Start line-wise visual mode | V | V | V |
| Start block-wise visual mode | Ctrlv | Ctrlv | Ctrlv |
| Search forward? searches backwards. | / | / | / |
| Next search matchN goes to the previous match. | n | n | n |
| Search for the word under the cursor# searches backwards. | * | * | * |
Windows, files, and ex commands
Ctrl+w prefixes window commands: press Ctrl+w, release, then press the command key.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Split the window horizontally | Ctrlws | Ctrlws | Ctrlws |
| Split the window vertically | Ctrlwv | Ctrlwv | Ctrlwv |
| Move to the window belowh, k, and l move left, up, and right. | Ctrlwj | Ctrlwj | Ctrlwj |
| Close the current window | Ctrlwq | Ctrlwq | Ctrlwq |
| Write the file | :w | :w | :w |
| Quit:wq writes and quits; :q! quits without saving. | :q | :q | :q |
| Substitute across the fileFull form: :%s/old/new/g replaces every occurrence in the file. | :%s | :%s | :%s |
Make the useful keys stick
Vim does not ask you to memorise a bag of tricks. It asks you to see a movement, an operation, and a mode. Once those pieces connect, the reference becomes a reminder rather than a crutch.
You do not need this whole page in your head. Pick two shortcuts that remove a repeated hand movement, use them until they feel ordinary, and come back for the next pair.