From 834be1d35c584f3c52d2be41e10d759332f4ee36 Mon Sep 17 00:00:00 2001 From: Tanushree Arora Date: Mon, 7 Jul 2025 14:21:23 +0530 Subject: [PATCH 1/4] vim cheatsheet added --- Terminal/vim.md | 136 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 1 deletion(-) diff --git a/Terminal/vim.md b/Terminal/vim.md index 035e9b84..736555ee 100644 --- a/Terminal/vim.md +++ b/Terminal/vim.md @@ -1 +1,135 @@ -# Vim zero to one \ No newline at end of file +## Vim zero to one + +No matter if you're a DevOps engineer, developer, or Linux enthusiast, knowing Vim helps you navigate and edit files efficiently from the terminal—especially when working on remote servers where GUI editors aren’t available. + +This cheat sheet will help you get started and become productive with Vim 👇 + +--- + +# What is Vim? + +Vim (Vi IMproved) is a highly configurable terminal-based text editor used for efficient text editing. It comes pre-installed on most UNIX systems. + +--- + +# Opening and Exiting Vim + +| Command | Description | +|--------|-------------| +| `vim filename` | Open file in Vim | +| `:q` | Quit (only if no changes) | +| `:q!` | Quit without saving | +| `:w` | Save file | +| `:wq` or `ZZ` | Save and quit | +| `:x` | Save and quit (same as `:wq`) | + +--- + +# Basic Modes + +| Mode | Description | +|------|-------------| +| `Normal` | Default mode (for navigation and commands) | +| `Insert` | Press `i`, `I`, `a`, `A`, `o`, or `O` to enter | +| `Visual` | Use `v`, `V`, or `Ctrl+v` to select text | +| `Command-line` | Use `:` to enter commands | + +Press `Esc` anytime to return to **Normal mode**. + +--- + +# Insert Mode Shortcuts + +| Key | Description | +|-----|-------------| +| `i` | Insert before cursor | +| `I` | Insert at the beginning of the line | +| `a` | Insert after cursor | +| `A` | Insert at the end of the line | +| `o` | Open new line below | +| `O` | Open new line above | + +--- + +# Navigation + +| Key | Description | +|-----|-------------| +| `h`, `j`, `k`, `l` | Move left, down, up, right | +| `w`, `W` | Jump by word | +| `b`, `B` | Jump back by word | +| `0` | Start of line | +| `^` | First non-blank character of line | +| `$` | End of line | +| `gg` | Go to beginning of file | +| `G` | Go to end of file | +| `:n` | Go to line number `n` | + +--- + +# Copy, Paste, Delete + +| Command | Action | +|---------|--------| +| `yy` | Yank (copy) line | +| `dd` | Delete line | +| `p` | Paste below | +| `P` | Paste above | +| `x` | Delete character | +| `u` | Undo | +| `Ctrl+r` | Redo | + +--- + +# Searching + +| Command | Description | +|---------|-------------| +| `/word` | Search forward | +| `?word` | Search backward | +| `n` | Repeat search forward | +| `N` | Repeat search backward | + +--- + +# Replace + +| Command | Description | +|---------|-------------| +| `r` | Replace one character | +| `R` | Enter replace mode | +| `:%s/old/new/g` | Replace all in file | +| `:s/old/new/g` | Replace all in current line | + +--- + +# Working with Files + +| Command | Description | +|---------|-------------| +| `:e filename` | Open another file | +| `:ls` | List open buffers | +| `:b2` | Switch to buffer 2 | +| `:w newfile` | Save as new file | + +--- + +# Plugins (Optional) + +Use a plugin manager like `vim-plug` to extend Vim: + +```vim +call plug#begin('~/.vim/plugged') +Plug 'preservim/nerdtree' " File explorer +Plug 'junegunn/fzf.vim' " Fuzzy finder +call plug#end() +``` + +--- + +# Resources + +- [Vim Official Website](https://www.vim.org) +- [Interactive Tutorial](https://www.openvim.com) +- [Cheat Sheet](https://vim.rtorr.com) +- `:help` in Vim to access built-in documentation \ No newline at end of file From 90dd718790b86d86717d7266d9df176a8f2391df Mon Sep 17 00:00:00 2001 From: Tanushree Arora Date: Mon, 7 Jul 2025 14:24:12 +0530 Subject: [PATCH 2/4] Revert "vim cheatsheet added" This reverts commit 834be1d35c584f3c52d2be41e10d759332f4ee36. --- Terminal/vim.md | 136 +----------------------------------------------- 1 file changed, 1 insertion(+), 135 deletions(-) diff --git a/Terminal/vim.md b/Terminal/vim.md index 736555ee..035e9b84 100644 --- a/Terminal/vim.md +++ b/Terminal/vim.md @@ -1,135 +1 @@ -## Vim zero to one - -No matter if you're a DevOps engineer, developer, or Linux enthusiast, knowing Vim helps you navigate and edit files efficiently from the terminal—especially when working on remote servers where GUI editors aren’t available. - -This cheat sheet will help you get started and become productive with Vim 👇 - ---- - -# What is Vim? - -Vim (Vi IMproved) is a highly configurable terminal-based text editor used for efficient text editing. It comes pre-installed on most UNIX systems. - ---- - -# Opening and Exiting Vim - -| Command | Description | -|--------|-------------| -| `vim filename` | Open file in Vim | -| `:q` | Quit (only if no changes) | -| `:q!` | Quit without saving | -| `:w` | Save file | -| `:wq` or `ZZ` | Save and quit | -| `:x` | Save and quit (same as `:wq`) | - ---- - -# Basic Modes - -| Mode | Description | -|------|-------------| -| `Normal` | Default mode (for navigation and commands) | -| `Insert` | Press `i`, `I`, `a`, `A`, `o`, or `O` to enter | -| `Visual` | Use `v`, `V`, or `Ctrl+v` to select text | -| `Command-line` | Use `:` to enter commands | - -Press `Esc` anytime to return to **Normal mode**. - ---- - -# Insert Mode Shortcuts - -| Key | Description | -|-----|-------------| -| `i` | Insert before cursor | -| `I` | Insert at the beginning of the line | -| `a` | Insert after cursor | -| `A` | Insert at the end of the line | -| `o` | Open new line below | -| `O` | Open new line above | - ---- - -# Navigation - -| Key | Description | -|-----|-------------| -| `h`, `j`, `k`, `l` | Move left, down, up, right | -| `w`, `W` | Jump by word | -| `b`, `B` | Jump back by word | -| `0` | Start of line | -| `^` | First non-blank character of line | -| `$` | End of line | -| `gg` | Go to beginning of file | -| `G` | Go to end of file | -| `:n` | Go to line number `n` | - ---- - -# Copy, Paste, Delete - -| Command | Action | -|---------|--------| -| `yy` | Yank (copy) line | -| `dd` | Delete line | -| `p` | Paste below | -| `P` | Paste above | -| `x` | Delete character | -| `u` | Undo | -| `Ctrl+r` | Redo | - ---- - -# Searching - -| Command | Description | -|---------|-------------| -| `/word` | Search forward | -| `?word` | Search backward | -| `n` | Repeat search forward | -| `N` | Repeat search backward | - ---- - -# Replace - -| Command | Description | -|---------|-------------| -| `r` | Replace one character | -| `R` | Enter replace mode | -| `:%s/old/new/g` | Replace all in file | -| `:s/old/new/g` | Replace all in current line | - ---- - -# Working with Files - -| Command | Description | -|---------|-------------| -| `:e filename` | Open another file | -| `:ls` | List open buffers | -| `:b2` | Switch to buffer 2 | -| `:w newfile` | Save as new file | - ---- - -# Plugins (Optional) - -Use a plugin manager like `vim-plug` to extend Vim: - -```vim -call plug#begin('~/.vim/plugged') -Plug 'preservim/nerdtree' " File explorer -Plug 'junegunn/fzf.vim' " Fuzzy finder -call plug#end() -``` - ---- - -# Resources - -- [Vim Official Website](https://www.vim.org) -- [Interactive Tutorial](https://www.openvim.com) -- [Cheat Sheet](https://vim.rtorr.com) -- `:help` in Vim to access built-in documentation \ No newline at end of file +# Vim zero to one \ No newline at end of file From 496a0e56f735073c514d39a0b0f53e491f5f7d0d Mon Sep 17 00:00:00 2001 From: Tanushree Arora Date: Mon, 7 Jul 2025 14:27:14 +0530 Subject: [PATCH 3/4] vim file updated --- Terminal/vim.md | 136 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 1 deletion(-) diff --git a/Terminal/vim.md b/Terminal/vim.md index 035e9b84..d2056df1 100644 --- a/Terminal/vim.md +++ b/Terminal/vim.md @@ -1 +1,135 @@ -# Vim zero to one \ No newline at end of file +# Vim zero to one + +No matter if you're a DevOps engineer, developer, or Linux enthusiast, knowing Vim helps you navigate and edit files efficiently from the terminal—especially when working on remote servers where GUI editors aren’t available. + +This cheat sheet will help you get started and become productive with Vim 👇 + +--- + +## 🧠 What is Vim? + +Vim (Vi IMproved) is a highly configurable terminal-based text editor used for efficient text editing. It comes pre-installed on most UNIX systems. + +--- + +## 🚀 Opening and Exiting Vim + +| Command | Description | +|--------|-------------| +| `vim filename` | Open file in Vim | +| `:q` | Quit (only if no changes) | +| `:q!` | Quit without saving | +| `:w` | Save file | +| `:wq` or `ZZ` | Save and quit | +| `:x` | Save and quit (same as `:wq`) | + +--- + +## ✍️ Basic Modes + +| Mode | Description | +|------|-------------| +| `Normal` | Default mode (for navigation and commands) | +| `Insert` | Press `i`, `I`, `a`, `A`, `o`, or `O` to enter | +| `Visual` | Use `v`, `V`, or `Ctrl+v` to select text | +| `Command-line` | Use `:` to enter commands | + +Press `Esc` anytime to return to **Normal mode**. + +--- + +## 🔡 Insert Mode Shortcuts + +| Key | Description | +|-----|-------------| +| `i` | Insert before cursor | +| `I` | Insert at the beginning of the line | +| `a` | Insert after cursor | +| `A` | Insert at the end of the line | +| `o` | Open new line below | +| `O` | Open new line above | + +--- + +## 🎯 Navigation + +| Key | Description | +|-----|-------------| +| `h`, `j`, `k`, `l` | Move left, down, up, right | +| `w`, `W` | Jump by word | +| `b`, `B` | Jump back by word | +| `0` | Start of line | +| `^` | First non-blank character of line | +| `$` | End of line | +| `gg` | Go to beginning of file | +| `G` | Go to end of file | +| `:n` | Go to line number `n` | + +--- + +## 📋 Copy, Paste, Delete + +| Command | Action | +|---------|--------| +| `yy` | Yank (copy) line | +| `dd` | Delete line | +| `p` | Paste below | +| `P` | Paste above | +| `x` | Delete character | +| `u` | Undo | +| `Ctrl+r` | Redo | + +--- + +## 🔍 Searching + +| Command | Description | +|---------|-------------| +| `/word` | Search forward | +| `?word` | Search backward | +| `n` | Repeat search forward | +| `N` | Repeat search backward | + +--- + +## 🛠️ Replace + +| Command | Description | +|---------|-------------| +| `r` | Replace one character | +| `R` | Enter replace mode | +| `:%s/old/new/g` | Replace all in file | +| `:s/old/new/g` | Replace all in current line | + +--- + +## 📁 Working with Files + +| Command | Description | +|---------|-------------| +| `:e filename` | Open another file | +| `:ls` | List open buffers | +| `:b2` | Switch to buffer 2 | +| `:w newfile` | Save as new file | + +--- + +## 🧩 Plugins (Optional) + +Use a plugin manager like `vim-plug` to extend Vim: + +```vim +call plug#begin('~/.vim/plugged') +Plug 'preservim/nerdtree' " File explorer +Plug 'junegunn/fzf.vim' " Fuzzy finder +call plug#end() +``` + +--- + +## 📚 Resources + +- [Vim Official Website](https://www.vim.org) +- [Interactive Tutorial](https://www.openvim.com) +- [Cheat Sheet](https://vim.rtorr.com) +- `:help` in Vim to access built-in documentation \ No newline at end of file From a22829eeb5cd63d5dcade6141496f77ef0d1d366 Mon Sep 17 00:00:00 2001 From: Tanushree Arora Date: Mon, 7 Jul 2025 14:31:14 +0530 Subject: [PATCH 4/4] vim files updated --- Terminal/vim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Terminal/vim.md b/Terminal/vim.md index d2056df1..2736bebd 100644 --- a/Terminal/vim.md +++ b/Terminal/vim.md @@ -132,4 +132,4 @@ call plug#end() - [Vim Official Website](https://www.vim.org) - [Interactive Tutorial](https://www.openvim.com) - [Cheat Sheet](https://vim.rtorr.com) -- `:help` in Vim to access built-in documentation \ No newline at end of file +- `:help` in Vim to access built-in documentation