If you are working on vi editor then it’s obvious that mistakenly you delete a line in vim editor .If this ever happened with you then you really need vim undo command. While working on vi editor it is must to know all the basic commands in vi editor command, it makes your work easy and faster. In this article we are explaining the basic commands of vi editor, lets check it out.

1. : u : To make undo changes you can enter the “u” command in vi editor. This command will be navigate you to last changes you have done.

2. Ctrl + R : this command will redo all the changes which were done. Redo command will redo last undone change. You have to use following shortcut like :

Ctrl + R

3. A : A command is used to append text ate the end.

4. X : This command is used to delete the unwanted character .

5. :wq : This command is used to save and exit.

6. :q! : this command is used to trash all the changes.

7. 2w : this command is used to move cursor two words forward.

8. 3e : this command is used to move cursor three word forward at the end of third word.

9. 0 : This is used to move to the start the line.

10. : w : this command is used to savethe file.

11. : n – this command is used to moves to line n of the file.

12. Yy – this command will copy a block of text.

13. N p- this command will paste the the text n times.

14. : recover – this command will recover a file from unexpected interruption.
Author
bhawanisingh
Views
1,463
First release
Last update
Rating
0.00 star(s) 0 ratings
Top