E

Section: Misc. Reference Manual Pages (P)
Updated: December 15, 1987
Index Return to Main Contents
 

NAME

e - command line preprocessor for the vi(1) editor.  

SYNOPSIS

e [ option ] [ file ] ...  

DESCRIPTION

e is an interface to vi(1) that maintains a history of the most recently e'ed files for each directory. Its invocation syntax is (almost) a superset of that of vi.

A file called .e is kept in each directory. This contains the history and is kept to a small length (<10 lines). Spelling corrections are suggested for simple mistakes (wrong character, omitted character, interchanged characters, extra character). The history file is rearranged with each use to place the last e'ed file at the end of the list. Duplicate entries are removed. If set, the environment variable VIPATH is read and the directories it contains are searched for an existing file with the same name before a new file is created. Thus one can vi across directories with ease.  

INVOCATION

A list of the command line variations is given below. [x] indicates that "x" is optional. "cmd" means a vi command.
e
Invokes vi on the last file that was e'ed in this directory.
e -
Prints the history for this directory and allows selection of a previous file - or a new one.
e .
Prints the history for this directory without asking for input.
e -t tag
Invokes vi -t tag
e -r
Invokes vi -r
e -r file
Invokes vi -r file
e -pat
vi's the last file that was e'ed with the string "pat" on the command line.
e +[cmd]
vi's the last file that was e'ed in this directory but executes command "cmd" on the way into. vi
e [+[cmd]] file
vi's the file and adds it to the history list. Minor spelling corrections are suggested if "file" does not exist but is close (in spelling) to some file that does.
e [+[cmd]] files
vi's the files and adds them as a single entry to the history.
 

EXAMPLE

With a ".e" file containing: fred.c
jane
alison
+/main pete.c
bigmac
fries juice

The command "e ." will give: [5]: fred.c
[4]: jane
[3]: alison
[2]: +/main pete.c
[1]: bigmac
[0]: fries juice

e
will get you fries and then juice.
e -
will present the same as shown for "e ." above but will ask for a number or another filename. Carriage return is equivalent to zero (i.e. the last filename), backspace or interrupt will quit.
e -ali
will get you alison.
e +/ketchup
will get you fries and juice, searching for ketchup in fries.
e bigamc
will ask if you want to correct to bigmac. "n" will not do the correction, "Q" or "q" will quit, anything else will go ahead. If there is more than one possible correction you will be prompted for each in turn. A response of "N" will means that you really want what you typed, no further corrections will be offered.
 

ENVIRONMENT VARIABLES

With an environment variable VIPATH set to "$HOME /usr/include/sys", e inode.h will prompt you with /usr/include/sys/inode.h if no file called inode.h exists in the current directory or your home directory. You can say "y", "n" or "q" to accept, reject or quit. If you accept then the file is put into the history. Spelling corrections are not suggested across directories. There is (of course) no need to put "." in your VIPATH. Doing so will just slow things down and cannot possibly be of help. This should be clear, "." is always searched first for the given filename. Putting it into your VIPATH will have it searched twice. The directory names in VIPATH may be separated by white space (including newlines) and colons.  

NOTES

When using e - the terminal is put into cbreak mode. If the first character typed is a digit (in the acceptable range of history items) then you will get that history item without further ado. Thus if you have a file called 4play and you try and e it from within a e - then you'll probably end up in the wrong place. This is to say you'll get the file that was the 4th last in the history.

The history length must be less than or equal to 9 (the code sets it to 8 at present). The problem with having more is that with e - you go into cbreak and the first digit entered (say n) is taken to mean "I want the nth last file". This saves the need for hitting return. With the history being kept as a most recently used list, 8 file names should be enough.  

BUGS

The first character on a select line cannot be backspaced over.  

THINGS TO DO

Make .exrc files be inherited when e'ing across directories.
Do spelling corrections across directories.
Plenty of fancy things. Keep a single .e file in $HOME and then it is possible to use history features in unwriteable directories etc. (suggested by ian! allen)
Version 2 will be a complete rewrite and will clean up the above and hopefully add cross directory spelling correction and other useful things.  

SEE ALSO

ex (1), edit (1).  

AUTHOR

Terry Jones
Department of Computer Science
University of Waterloo


 

Index

NAME
SYNOPSIS
DESCRIPTION
INVOCATION
EXAMPLE
ENVIRONMENT VARIABLES
NOTES
BUGS
THINGS TO DO
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 21:49:27 GMT, February 02, 2023