While running through Unix I felt that Vi editor is the very powerful editor in comparison to others and have capability to handle any type of file. It’s same as any other text editor but having some powerful features. Vi editor is written by Bill Joy in 1976 for BSD system. It comes with every Unix system. Vi editor is very and first step to learn Shell Script, generally we write our script in same. To find the Vi editor in Unix, you just go through terminal (In windows, we call it Command Prompt but in Unix we call it Terminal) and type Vi and hit enter. It will open the Vi editor. It is having 3 main modes
- Command Mode
- Input Mode
- Last Line Mode
The default mode of Vi editor which accept any text as a command called as Command Mode. To come in Input mode from command mode you should press “i” key first. It will change Vi command mode to Input mode. Every key pressed after switching to Input mode actually shows up as text. We are writing shell script in Input mode. We used Esc key to take this mode to Command Mode. Last line mode is used to handle files like for saving and perform substitution. Pressing a colon (:) in the Command Mode invokes this mode.
This is the very basic things about Vi editor but I think it is also useful for beginner. Here you can find some useful command of VI editor http://www.cs.rit.edu/~cslab/vi.html