Vim is a text editor that is widely used in the Linux/Unix environment.
Here are some basic commands that you can use in Vim:
To open a file in Vim
vim <file_name>To switch between normal mode and insert mode
- Press
ito enter insert mode, which allows you to type in the text. - Press
Escto return to normal mode.
To save changes and exit Vim
- Press
Escto return to normal mode - Type
:wto save changes - Type
:qto exit Vim - If you have made changes and want to save and exit at the same time, type
:wq
To move the cursor
Use the arrow keys to move the cursor up, down, left, or right
- Or use the following keys to move more quickly:
hto move leftjto move downkto move uplto move right
To delete text
- Position the cursor over the text you want to delete.
- Press
xto delete the character under the cursor. - Press
ddto delete the entire line.
To copy and paste text
Position the cursor over the text you want to copy
- Press
yyto copy the entire line. - Position the cursor where you want to paste the text.
- Press
pto paste the copied text after the cursor, orPto paste before the cursor.
To search for text
Press / to enter search mode
- Type the text you want to search for, and press
Enter - Press
nto move to the next occurrence of the search term, orNto move to the previous occurrence.
These are just a few basic commands to get you started. Vim has many more commands and features that you can learn as you become more familiar with the editor.
For More Command Check below Cheat Sheet.

Download the Above Cheat Sheet Image by Link