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

Advertisements

8 thoughts on “Vi Editor

  1. Hey
    Really Vi editor is very powerful. Actually, this editor works on the copy of the file in memory, and only updates the file on disk when you tell it to, such as when you exit.

  2. Hi Mayank,

    Yeah, I agree with you as vi editor is the one of best editors and for shell scripting it’s robust to use But Vi has its dark sides, too. The biggest one is the need to step back before leaping forward when you are new to Vi. You cannot use Vi properly before knowing at least a handful of commands. This makes the threshold rather high. Vi doesn’t get fast before you know 25 commands or so, and you won’t be the novice user before you know even more.

    In my opinion if you are a Windows user and you are forced to work under Unix for a week: don’t learn Vi. However, if you need a good, multi-purpose editor, then Vi is a very good, highly recommended choice. Invest some time and learn Vi 🙂 and its good that u r doing so.

    Keep up the good work.

    Regards,
    Ajai

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s