The 'vi' program is a command line editor for posix systems (Linux systems like ClearOS and Unix systems like Solaris and Mac OSX are posix systems). The command vi is short for visual and is described as: a screen-oriented (visual) display editor. A simpler alternative which is also pervasive is 'nano'.
It is worth our attention because it is so pervasive among so many systems. If you are already used to using a different command line editor then vi may not be for you. We mention it here because it is pervasive and not because we advocate it above any other editor. If you are happy with the editor you know, keep using it. If you have never used an editor before or you want to learn vi, then this article is for you.
Vi has two basic modes, command mode and insert mode. When you are in command mode you can do things like:
In edit mode you can:
To enter command mode from insert mode, hit the <esc> key. To enter insert mode, from command mode type the 'i' key. When you are in insert mode, the word – INSERT – will appear at the bottom line of the screen. When you escape insert mode, the word – INSERT – will no longer appear at the bottom of the screen. Also, when you press <esc> while in command mode already, your system may beep at you. This is ok and useful feedback.