by Larry Ayers <layers@vax2.rain.gen.mo.us>
Copyright (c) 1996
In this era of WYSIWYG editors and word processors it is remarkable that successors to the ancient (in computer chronology) vi editor are still under active development. Considering the seeming handicaps vi-style editors are burdened with, such as a lack of icons, pulldown menus, and graphical glitz in general, there must be some basic, behind-the-scenes functionality involved which keeps these editors in use.
A typical initial reaction to vi is confusion and repugnance. There are no visual clues as to what to do in order to even enter text; my first experience with vi was mainly an exercise in figuring out how to exit the thing. But once you manage to learn about a dozen or so basic keystrokes and begin to keep in mind which mode you're in, text manipulation really accelerates.
A few years ago Paul Fox began to tinker with the source code of the Microemacs editor. He ended up with an editor which had the basic vi command set, but with a layer of emacs-like control-key commands which added more functions to vi. VI Like Emacs.
The editor has been through quite a lengthy development cycle with many programmers joining in. It's been ported to DOS, Windows, OS/2, and of course all varieties of unix. Excellent x-window support is now a compilation option.
Compiling and installing vile and/or xvile is painless. Makefiles are included for all the above-mentioned operating systems, and a well-done configure script tailors the makefile to your system. Just type "./configure" for standard vile, or "./configure --with-screen=x11", then "./make", followed by the usual "./make.install" and "./make.man".
Vile is not strictly speaking a clone of vi, but as Paul Fox puts it the editor has a "finger feel" like vi's. Unlike vi, multiple windows and buffers are implemented, as well as an easy-to-use keyboard-remapping and macro facility. As in emacs, you can browse through directory listings and call up files to be edited. This feature is not as option-rich as emacs' dired, but I don't require of an editor that it double as a full-featured file-manager.
"Infinite undo" is a really handy feature; you can step your way back through changes you've made as far as you want.
Various programmer's modes are available, as well as a "next error" command. Keyword highlighting is still under development in the form of a loadable module.
All of vi's good features have been retained, such as searching with the / and ? keys, and command repeating with a ".".
The X-windows support is very complete. Xvile is configurable through entries in your .Xdefaults or .Xresources file, giving the user control of fonts, screen colors, and the scrollbar.
A very complete help file is available via a keystroke within the editor, which is a big help for a new vi user.
Before I began using xvile, I would use gnu emacs for large editing tasks and something smaller like elvis or xedit for minor editing. Emacs takes so long to load that it's not practical to be constantly starting and quitting it, and I would rather not have it loaded all of the time. It's a massive beast of an editor! The vile editors are a happy medium between the two; xvile takes less than a second to start up on my 486, and vile appears practically instantly.
I still use emacs when I have a lot of cutting and pasting to do, and would like to be able to see the contents of the various cut-buffers. In vile you have plenty of buffers available but they're invisible, which makes them difficult to keep track of after several have been accumulated.
One feature which rapidly has become indispensable to me, and should be valuable for anyone who spends much time in DOS/Windows/OS/2, is a specific mode for reading non-unix text files, with those annoying extra ^M's at the end of each line. In this mode vile automatically strips off the superfluous ^M characters, then restores them when you quit the file. Since you can specify any .vilerc configuration file on the command line (or, as I do, in a vile icon's config file), vile can be started up in this dos-mode and then you can edit files from a DOS or OS/2 partition to your heart's content.
I didn't include a screenshot with this article. Regular vile looks just like vi (with the addition of a configurable status-line at the bottom) and xvile looks like any other x-window, depending on what window-manager you use.
The most recent version (as of this writing, 5.6) is available via anonymous ftp fromPaul Fox's ftp site. The source code is there, as well as precompiled versions for DOS and OS/2.
I hope I've convinced at least a few of you to give vile a try. If you do, try out the sample .Xresource foreground and background colors listed in the help-file. The first time I did this, I looked at the resultant text and thought, "Where have I seen this before?" Then it dawned on me that the colors used were a pretty accurate recreation of an old-style blackboard with chalk-colored text.
Back up to the Linux Gazette!