Catalog / Vim Cheatsheet
Vim Cheatsheet
A comprehensive cheat sheet for Vim, covering essential commands, modes, navigation, editing, and advanced features to boost your coding efficiency.
Basic Navigation
Movement
|
Move cursor left |
|
Move cursor down |
|
Move cursor up |
|
Move cursor right |
|
Move to the beginning of the next word |
|
Move to the beginning of the previous word |
|
Move to the beginning of the line |
|
Move to the end of the line |
Scrolling
|
Scroll down half a page |
|
Scroll up half a page |
|
Scroll forward one full page |
|
Scroll backward one full page |
Line Navigation
|
Go to the first line of the file |
|
Go to the last line of the file |
|
Go to a specific line number (e.g., |
Editing Commands
Basic Editing
|
Insert before the cursor |
|
Append after the cursor |
|
Open a new line below the current line |
|
Open a new line above the current line |
|
Delete character under cursor |
|
Delete the current line |
Copy, Paste, and Delete
|
Yank (copy) the current line |
|
Paste after the cursor |
|
Paste before the cursor |
|
Delete word |
|
Delete to end of line |
|
Delete to end of line |
Undo and Redo
|
Undo last change |
|
Redo last undone change |
|
Repeat the last command |
Search and Replace
Searching
|
Search for |
|
Search for |
|
Find next occurrence |
|
Find previous occurrence |
Replacing
|
Replace all occurrences of |
|
Replace all occurrences of |
|
Replace all occurrences of |
Visual Mode Search & Replace
|
Saving and Exiting
Saving
|
Save the current file |
|
Save the current file as |
Exiting
|
Quit Vim (only if no changes have been made) |
|
Quit Vim, discard all changes |
|
Save and quit |
|
Save and quit (only if changes have been made) |
|
Save and quit (if changes have been made) |
Combining Saving and Exiting
You can combine saving and exiting commands. For example, |