VIM is gem!!
What is VIM? Basically, VIM will help you to code faster than you think, by using some commands. If you learn VIM, it's an advantage while competing with others, as well as it will increase your productivity. Yeah, you will not need a mouse anymore. If you don't get it, don't worry. We will figure it out in this blog! Official site of VIM VIM git repo Here you can download Or refer some YouTube videos Download VIM on Linux sudo apt update sudo apt install vim Open your terminal to check vim installed or not. vim You can see something like this in your terminal. To exit, type :q and enter. Use VIM in VScode Add an extension named Vim to your VS code. Here we start After that, create a file. You can notice that the cursor has become wider. Also, you can notice the VIM modes in the bottom left of your VS code (Here is NORMAL). While pressing i you can see the mode become Insert and the cursor become smaller. Now you are in insert mode. Type anything (actually your codes) and press esc so you can escape from the insert mode to normal mode. Commands starting with : symbols you can see in the bottom left of your VS Code. Type :q to save your code written. Below are some codes; play with them and learn more... Here are the important commands to master VIM. Basic Navigation h → Move left l → Move right j → Move down k → Move up w → Move to the next word b → Move to the previous word 0 → Move to the beginning of the line ^ → Move to the first non-whitespace character $ → Move to the end of the line gg → Go to the beginning of the file G → Go to the end of the file :n → Jump to line n (:10 goes to line 10) Insert Mode i → Insert before the cursor I → Insert at the beginning of the line a → Append after the cursor A → Append at the end of the line o → Open a new line below O → Open a new line above Editing x → Delete the character under the cursor dw → Delete a word dd → Delete a line D → Delete from cursor to the end of the line yy → Copy (yank) a line yw → Yank a word p → Paste after the cursor P → Paste before the cursor u → Undo Ctrl + r → Redo Searching & Replacing /word → Search for "word" n → Jump to the next occurrence N → Jump to the previous occurrence :%s/old/new/g → Replace all occurrences of "old" with "new" :%s/old/new/gc → Replace with confirmation Saving & Exiting :w → Save :q → Quit :wq or :x → Save and quit :q! → Quit without saving ZZ → Save and exit (shortcut) Visual Mode v → Start visual mode (select text character by character) V → Start line-wise visual mode Ctrl + v → Start block visual mode y → Yank (copy) selected text d → Delete selected text > → Indent selected text < → Un-indent selected text Windows & Tabs :split or :sp → Split window horizontally :vsplit or :vsp → Split window vertically Ctrl + w + w → Switch between windows :tabnew → Open a new tab gt → Switch to the next tab gT → Switch to the previous tab Thank you! Happy coding...

What is VIM? Basically, VIM will help you to code faster than you think, by using some commands. If you learn VIM, it's an advantage while competing with others, as well as it will increase your productivity. Yeah, you will not need a mouse anymore. If you don't get it, don't worry. We will figure it out in this blog!
Official site of VIM
VIM git repo
Here you can download
Or refer some YouTube videos
Download VIM on Linux
sudo apt update
sudo apt install vim
Open your terminal to check vim installed or not.
vim
You can see something like this in your terminal. To exit, type :q
and enter.
Use VIM in VScode
Add an extension named Vim to your VS code.
Here we start
After that, create a file. You can notice that the cursor has become wider. Also, you can notice the VIM modes in the bottom left of your VS code (Here is NORMAL).
While pressing i
you can see the mode become Insert and the cursor become smaller. Now you are in insert mode. Type anything (actually your codes) and press esc
so you can escape from the insert mode to normal mode.
Commands starting with :
symbols you can see in the bottom left of your VS Code. Type :q
to save your code written.
Below are some codes; play with them and learn more...
Here are the important commands to master VIM.
Basic Navigation
h → Move left
l → Move right
j → Move down
k → Move up
w → Move to the next word
b → Move to the previous word
0 → Move to the beginning of the line
^ → Move to the first non-whitespace character
$ → Move to the end of the line
gg → Go to the beginning of the file
G → Go to the end of the file
:n → Jump to line n (:10 goes to line 10)
Insert Mode
i → Insert before the cursor
I → Insert at the beginning of the line
a → Append after the cursor
A → Append at the end of the line
o → Open a new line below
O → Open a new line above
Editing
x → Delete the character under the cursor
dw → Delete a word
dd → Delete a line
D → Delete from cursor to the end of the line
yy → Copy (yank) a line
yw → Yank a word
p → Paste after the cursor
P → Paste before the cursor
u → Undo
Ctrl + r → Redo
Searching & Replacing
/word → Search for "word"
n → Jump to the next occurrence
N → Jump to the previous occurrence
:%s/old/new/g → Replace all occurrences of "old" with "new"
:%s/old/new/gc → Replace with confirmation
Saving & Exiting
:w → Save
:q → Quit
:wq or :x → Save and quit
:q! → Quit without saving
ZZ → Save and exit (shortcut)
Visual Mode
v → Start visual mode (select text character by character)
V → Start line-wise visual mode
Ctrl + v → Start block visual mode
y → Yank (copy) selected text
d → Delete selected text
> → Indent selected text
< → Un-indent selected text
Windows & Tabs
:split or :sp → Split window horizontally
:vsplit or :vsp → Split window vertically
Ctrl + w + w → Switch between windows
:tabnew → Open a new tab
gt → Switch to the next tab
gT → Switch to the previous tab
Thank you! Happy coding...