Getting Started with vi
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.
The basics
Vi has two basic modes, command mode and insert mode. When you are in command mode you can do things like:
- Navigate the document
- Switch to different documents
- Save the document
- Search for words or phrases
- Find and replace
In edit mode you can:
- Insert text
To enter command mode from insert mode, hit the