-->

Previous | Table of Contents | Next

Page 217

Variants of the Visual Editor Improved—vim

The vim editor, by Bram Moolenaar, is a text editor compatible with the original Berkeley Software Distribution vi editor by Bill Joy. An X11 version is called gvim and sports multiple scrolling windows and menus.

TIME SAVER
Although the vim :version command shows that the systemwide vimrc and gvimrc resource files are located under the /usr/share/vim directory, this is not true; you won't find these files installed with the vim package. However, you can create your own resource file after making changes to vim while running the editor, and then using the :mkvimrc command. A resource file called .vimrc (which you can copy to .gvimrc) is created in your home directory, and contains your changes. You can then edit and add your own commands, configurations, and menus to these files.

Several symbolic links are created on your system when you install the vim package from your CD-ROM:

The vim editor is used as a replacement for the ex, vi, and view editors (see Figure 14.2). Although vim is a visual editor, supporting features such as cursor movement, when invoked as ex, the vim editor emulates the ex script editor.

The vim editor features a number of improvements over the traditional vi editor, and has 23 different command-line options. In vim you'll find built-in help, split-screen windows, block moves, command-line editing, horizontal scrolling, and word wrap for word processing.

The gvim version of vim, used under the X Window System, has custom colors, window sizes, scrollbars, and menus. You can create your own set of menus containing specific vim commands, and generate different versions of vim by saving your features in different gvim resource files. You can then use the -u command-line option to load a custom version.

Creating new menus for gvim is easy. You can, for example, group related macros or custom commands you've created into a separate menu. For details about building custom

Page 218

Figure 14.2.
The X11 version of the
vim editor, gvim,
features split scrollable
windows, along with
menus you can
customize.


menus, read the files vim_menu.txt and vim_gui.txt under the /usr/share/vim directory.

Most of the documentation for vim is contained in its built-in help, and there are 21 text files containing extensive instructions in the /usr/share/vim directory.

Features of Pine's pico Editor

The pico editor, included with the University of Washington's pine electronic mail program, is a compact, efficient, and easy-to-use editor usually used to compose or reply to e-mail messages. This editor is a nifty replacement for all your editing needs, and is especially handy if you need a reliable text editor, but don't have a lot of hard drive space (for example, on a laptop).

Despite its relatively small size, the pico editor has most of the features you'd expect in a word processor, including

The pico editor has 16 different command-line options and rudimentary crash protection

Page 219

Figure 14.3.
The pico editor, part of
the pine electronic mail
program distribution, is
a compact and easy-
to-use editor with
nearly all of the basic
features of a text
editor.


(see Figure 14.3). It attempts to save any work in progress before exiting, saving your file with a name ending in .save, or if unsaved, in a file named pico.save.

This editor is an excellent choice for your $EDITOR environment variable, as it is much friendlier and easier to learn than the default $EDITOR variable, which points to the vi command. As the root operator, set the $EDITOR variable for all users by editing the /etc/profile file, and inserting the following line:


EDITOR=/usr/bin/pico

Also, make sure that the following line contains the word EDITOR:


export USERNAME ENV PATH EDITOR

Save the file, and then enter the following to use the new $EDITOR variable:


# source /etc/profile

After you do this, any Linux command requiring a default system editor will use pico. Also use these changes in the .bash_profile file in your home directory.

You'll find documentation for pico in its manual page, or you can use the lynx Web browser to read the pine and pico technical documentation with the following:


# lynx /usr/doc/pine-3.96/tech-notes/index.html

Five Editors in One—joe

The joe editor, by Joseph H. Allen, comes in five different versions: jmacs, joe, jpico, jstar,

Page 220

and rjoe (see Figure 14.4). The jmacs version emulates the emacs editor. The jpico version emulates the pine mailer's pico text editor. The jstar version uses WordStar-compatible keyboard commands, while the rjoe program is a restricted editor.

joe's configuration files are found under the /usr/lib/joe directory. Copy the file called joerc to your home directory, save it with the .joerc filename, and then edit this file to change joe's

Figure 14.4.
The joe editor comes
in five versions, and
can emulate the
keyboard commands
of several different
editors, such as pico
and emacs.



help menus, display, and keyboard commands.

You'll find documentation for the joe editor in its manual page (which needs to be spell checked), and by using its built-in help.

There is a bug in the version of joe on your CD-ROM that involves proper resizing of the editor in consoles or X11 windows greater than 80 characters by 25 lines in size. Upgrade to the newer version by obtaining and installing the joe-2.8-10.i386.rpm file. You can get this file from Red Hat Software by browsing to the following site:


ftp://ftp.redhat.com/pub/redhat/updates/5.0/i386/

Configuring the jed Editor

The jed editor, by John E. Davis, comes in two versions: one for the console, and the other tailored for the X Window System (see Figure 14.5).

jed's main configuration files may be found under the /usr/lib/jed/lib directory, and you may customize how jed runs by placing preferences in a .jedrc file in your home directory. Copy the file jed.rc from the /usr/lib/jed/lib directory to your home directory as .jedrc, and then edit to your taste.

The jed editor has built-in help, but you'll find information about jed under the /usr/doc directory, in its manual page, and in info files under the /usr/lib/jed/info directory.

Previous | Table of Contents | Next