Use Gvim for a Better vi Experience

A good, simple plain text editor is definitely a handy thing to have available …

If you edit configuration files by hand, or if you prefer a more “manual” approach to the process of writing, you most likely use a text editor. Of the available editors there exists everything from bare-bones, no frills editors all the way to highly complex feature-abundant editors (and everything in between). One of those editors was born out of a need to make one of the most powerful text editors available – vi.

For most users, vi offers too much with too little help. To that end, tools like Gvim were created. Gvim is a strange amalgamation of a standard text-based file editor and a graphical file editor. Its half vi half gedit. Let’s take a look at how this editor can help you out.


The installation of Gvim is simple. I will demonstrate in Ubuntu. Since Gvim is found in the standard repositories, you can follow these steps:

  1. Open up a terminal window.
  2. Issue the command sudo apt-get install gvim.
  3. Type your sudo password and hit Enter.
  4. Allow the installation to complete.

You can find Gvim in the Ubuntu Software Center (or the Add/Remove Software tool for your distribution), but since Gvim is a text-based editor, why not install from command line?

After the installation is complete, you will be surprise to not find a menu entry for Gvim. So to start up Gvim hit Alt-F2 and enter the command gvim in the run dialog. When the application starts, you will see a nice hybrid tool that will make using vi much easier.


Figure 1

As you can see, in Figure 1, Gvim has the standard editing window, but with a few editions. The most obvious edition is the tool bar. Add to that tool bar a menu bar, and you have the makings for an actual user-friendly vi experience.

If you’ve never used vi, let me give you the gist of how you type and save a file…step by step.

  1. Open up vi.
  2. Hit the “i” key to switch vi to “insert” mode.
  3. Type your file.
  4. Hit “Escape” to get out of “insert” mode.
  5. Hit the Shift “:” to get to the command mode.
  6. Type “wq” (no quotes) to save the file and exit.

Quite a few steps just to save a text file right? Now, with Gvim, the same task looks like this:

  1. Open Gvim.
  2. Hit the “i” key to go into “insert” mode.
  3. Type your text.
  4. Hit the Save button.
  5. Give your file a name.

That’s it. Although only one step shorter, but a heck of a lot user-friendlier.

But don’t Gvim only aids the simple tasks. Gvim also brings to the user some of the more challenging tasks such as:

  • Spell checking.
  • Jump to tags.
  • Automatic syntax.
  • Color testing.
  • Window splitting.

And much more…all from handy drop-down menus and tool-bar icons.  The developers of Gvim even thought to include a handy print button!

Final thoughts

If you have been wanting to give the vi editor a go, you can breathe a sigh of relief and enjoy a helpful hybrid version of vi that will have you editing like a power user.



© Jack Wallen for gHacks Technology News, 2011. | Permalink | Add to, digg, facebook, reddit, twitter
Post tags: , , , , ,

Link to Original Content

Tags: , , , , ,

Comments are closed.