https://github.com/yeasinarafat1/mastering-vim
Comprehensive Vim Cheat Sheet with essential commands, shortcuts, and installation guides for Windows, macOS, and Linux. Perfect for developers, sysadmins, and Vim enthusiasts looking to boost productivity and master Vim efficiently.
https://github.com/yeasinarafat1/mastering-vim
cheatsheat install linux open-source productivity productivity-booster productivity-tool terminal terminal-based text-editor vim vim-syntax vim-tips windows
Last synced: 4 months ago
JSON representation
Comprehensive Vim Cheat Sheet with essential commands, shortcuts, and installation guides for Windows, macOS, and Linux. Perfect for developers, sysadmins, and Vim enthusiasts looking to boost productivity and master Vim efficiently.
- Host: GitHub
- URL: https://github.com/yeasinarafat1/mastering-vim
- Owner: yeasinarafat1
- Created: 2024-12-22T19:07:58.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-22T19:16:42.000Z (6 months ago)
- Last Synced: 2024-12-31T20:18:45.590Z (5 months ago)
- Topics: cheatsheat, install, linux, open-source, productivity, productivity-booster, productivity-tool, terminal, terminal-based, text-editor, vim, vim-syntax, vim-tips, windows
- Homepage: https://www.vim.org/
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vim Cheat Sheet
---
## Installation Instructions
1. **Windows**:
Download the official installer from [vim.org](https://www.vim.org/download.php) and follow the setup process.
Alternatively, use **Chocolatey** or **Scoop** to install Vim:
- Chocolatey: `choco install vim -y`
- Scoop: `scoop install vim`2. **Linux**:
Use your package manager:
- For Ubuntu/Debian: `sudo apt install vim`
- For Fedora: `sudo dnf install vim`
- For Arch: `sudo pacman -S vim`3. **macOS**:
Install Vim via **Homebrew**: `brew install vim`---
## MODES
- **Esc**: Enter Normal mode.
- **i**: Enter Insert mode.
- **v**: Enter Visual mode.
- **:**: Enter Command-line mode.---
## FILE OPERATIONS
- `:w`: Save file.
- `:q`: Quit.
- `:wq`: Save and quit.
- `:q!`: Quit without saving.
- `:e filename`: Open a file.
- `:x`: Save and quit (same as `:wq`).---
## NAVIGATION
### Move by Character
- `h`: Left.
- `l`: Right.
- `j`: Down.
- `k`: Up.### Move by Word
- `w`: Next word.
- `b`: Previous word.
- `e`: End of the current/next word.### Move by Line
- `0`: Start of the line.
- `^`: First non-whitespace character.
- `$`: End of the line.### Move by Paragraph
- `{`: Beginning of the previous paragraph.
- `}`: Beginning of the next paragraph.### Move by Screen
- `Ctrl + u`: Half-screen up.
- `Ctrl + d`: Half-screen down.
- `Ctrl + b`: Full-screen up.
- `Ctrl + f`: Full-screen down.### Move to Specific Lines
- `gg`: First line of the file.
- `G`: Last line of the file.
- `:n`: Go to line `n`.---
## EDITING
### Insert Text
- `i`: Insert before the cursor.
- `a`: Insert after the cursor.
- `o`: Open a new line below.
- `O`: Open a new line above.### Delete
- `x`: Delete a character.
- `dd`: Delete the current line.
- `dw`: Delete a word.
- `d$`: Delete to the end of the line.### Undo/Redo
- `u`: Undo.
- `Ctrl + r`: Redo.### Copy/Paste
- `yy`: Copy (yank) the current line.
- `yw`: Yank a word.
- `p`: Paste after the cursor.
- `P`: Paste before the cursor.### Replace
- `r`: Replace the current character with ``.
- `R`: Enter Replace mode.---
## VISUAL MODE
- `v`: Start visual selection.
- `V`: Start line selection.
- `Ctrl + v`: Start block (column) selection.
- `d`: Delete selected text.
- `y`: Yank (copy) selected text.---
## SEARCH AND REPLACE
- `/pattern`: Search for `pattern`.
- `n`: Repeat the search forward.
- `N`: Repeat the search backward.
- `:s/old/new`: Replace the first occurrence of `old` with `new` in the current line.
- `:s/old/new/g`: Replace all occurrences in the current line.
- `:%s/old/new/g`: Replace all occurrences in the entire file.
- `:%s/old/new/gc`: Replace all with confirmation.---
## WINDOW MANAGEMENT
- `:split`: Split horizontally.
- `:vsplit`: Split vertically.
- `Ctrl + w w`: Switch between windows.
- `Ctrl + w q`: Close the current window.
- `Ctrl + w o`: Close all other windows.---
## BUFFER MANAGEMENT
- `:e file`: Open a file in a new buffer.
- `:ls`: List all buffers.
- `:b n`: Switch to buffer `n`.
- `:bd`: Close the current buffer.---
## EXTRAS
- `:set number`: Show line numbers.
- `:set relativenumber`: Show relative line numbers.
- `:syntax on`: Enable syntax highlighting.
- `:set hlsearch`: Highlight search results.
- `:set nohlsearch`: Turn off search highlights.---
## EXITING HELP
- `:q`: Exit help.---
**Enjoy editing with Vim!** 😊