Created
January 19, 2026 17:00
-
-
Save abubaker417/af1285b1e62a63ef832bbaabaf3a711c to your computer and use it in GitHub Desktop.
Vim Commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## πΉ Vim Modes (most important concept) | |
| - `i` β Insert mode (start typing) | |
| - `Esc` β Back to Normal mode (always your safe key) | |
| - `:` β Command mode | |
| - `v` β Visual mode (select text) | |
| ------ | |
| ## πΉ File Commands | |
| - `:w` β Save file | |
| - `:q` β Quit | |
| - `:wq` β Save & quit | |
| - `:q!` β Quit without saving | |
| - `:e filename` β Open another file | |
| ------ | |
| ## πΉ Moving Around (Navigation) | |
| - `h` β Left | |
| - `l` β Right | |
| - `j` β Down | |
| - `k` β Up | |
| π Faster movement: | |
| - `w` β Next word | |
| - `b` β Previous word | |
| - `0` β Start of line | |
| - `$` β End of line | |
| - `gg` β Top of file | |
| - `G` β Bottom of file | |
| - `:n` β Go to line number `n` (e.g. `:25`) | |
| ------ | |
| ## πΉ Editing Text | |
| - `i` β Insert before cursor | |
| - `a` β Insert after cursor | |
| - `o` β New line below | |
| - `O` β New line above | |
| - `x` β Delete character | |
| - `dd` β Delete line | |
| - `yy` β Copy (yank) line | |
| - `p` β Paste | |
| - `u` β Undo | |
| - `Ctrl + r` β Redo | |
| ------ | |
| ## πΉ Visual Mode (Selection) | |
| - `v` β Select characters | |
| - `V` β Select whole line | |
| - `Ctrl + v` β Block (column) selection | |
| - After selecting: | |
| - `d` β Delete | |
| - `y` β Copy | |
| - `p` β Paste | |
| ------ | |
| ## πΉ Search & Replace | |
| - `/word` β Search forward | |
| - `?word` β Search backward | |
| - `n` β Next match | |
| - `N` β Previous match | |
| π Replace: | |
| ``` | |
| :%s/old/new/g | |
| ``` | |
| - `%` β Entire file | |
| - `g` β Replace all occurrences | |
| ------ | |
| ## πΉ Useful Power Commands (Very Handy) | |
| - `.` β Repeat last command | |
| - `>>` β Indent line | |
| - `<<` β Unindent line | |
| - `:%y+` β Copy entire file | |
| - `:set number` β Show line numbers | |
| - `:set nonumber` β Hide line numbers | |
| ------ | |
| ## πΉ Emergency Escape π | |
| If Vim ever feels βstuckβ: | |
| ``` | |
| Esc β :q! β Enter | |
| ``` | |
| ------ | |
| ### β If you remember ONLY 10 commands | |
| ``` | |
| i Esc :w :q :wq | |
| dd yy p u /search | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment