Using the vi editor (Short Version)

The vi editor has two modes
1) The Command mode
2) The Insert mode

with the Command mode you can move around the file with the arrow keys and you can use the del key or keys like x to delete letters.

with the Insert mode you can insert characters using the keyboard.

Note: You cannot enter any letters when you are in the command mode. You must enter the Insert mode before typing in anything.

Common Task:

Say you want to delete a particular letter or a word and then insert some other word in its place. This is what you would do

By default the vi editor starts up with the Command mode.
Move your cursor to the letter you want to delete and press ‘x’ or ‘del’ key.
This will delete the letter.
Press ‘i’ to enter into the Insert mode.
Now your keyboard can enter alphabets and numbers.
Insert the content you want.
Press ‘Esc’ key to go back to the Command mode.
Remember that to delete a letter you should go to the command mode.

Note: To Undo a particular typo or a delete, press ‘u’ in the command mode to undo. Works like any other word editor.


Using the vi Editor (long version, external link)

For some the vi editor might be a nightmare to work with

Sad to say It was one for me too and i never liked it

So here’s how you can make your life easy

Take time and read this for a few minutes you will be really comfortable with it.