top of page
Writer's pictureMukesh Chanderia

Linux - Commands Part 6 "VIM" Editor

Updated: Aug 21, 2021

VIM is the powerful and most popular text editor.


Escape Mode : When we enter in file through vim command then we are in escape mode.


You can execute the following functions in escape mode.


1) Press x and the alphabet on which the curser is present will get deleted.

2) Type number of characters you want to delete and then press x.

Example : type "3x" to delete three characters.

3) If you want to remove complete word type "d+w" -⇾ delete word.

4) Type twice d i.e. "dd" to delete full line.

5) To remove three lines press "3+ dd"

6) To go to bottom press "Shift + G"

7) To go to top press two times "gg"

8) Press "u" to undo all changes

9) Control + R to redo

10) to come out of file "Shift+ 2 times z".


Insert mode : From escape mode type "i" to get inside insert mode.


You can execute following functions in insert mode.

1) Whatever you type will print before curser.

2) Press Esc to get out of insert mode to escape mode.

3) From escape mode press "a" & whatever you type will print after curser.

4) From escape mode Press "o" to create blank line below curser.

5) From escape mode press Shift+"o"-⇾ Create a blank line above curser.


To save file


Esc + :w --> write

Esc + :wq --> write and quit

Esc + :q! --> quit without saving



4 views0 comments

Comments


bottom of page