v edit file(s) with vim, (or gvim, emacs)
doc generated from the script with gendoc
bash script, version=1.01


v [options]
# -h --help -H --Help -V --version
v [file... ]
# edit one or more files
v -script [file...]
# edit script found in PATH plus 0 or more files
v --texfile [file... ]
# edit TeX file found with kpsewhich plus 0 or more files
v nnnn [file... ]
# edit nnnn/main.tex found in $ARCHIVE plus 0 or more files


This script is called v, and it runs vim. However, if installed as links to v named g or e, then gvim or emacs are called instead. In the latter case, if emacs is not found, xemacs is called, and if an emacs server is running, it is used for editing.

If given one or more files they let you edit those files, just like the vim, gvim or emacs editors. However, the first of the given file arguments is treated differently from the rest:

(a 4-digit number):
if a non-binary regular file with that name exists in the current directory, they let you edit this file; if no such file exists, they look for an archive file which is defined as a file main.tex in the directory $ARCHIVE/nnnn, if such a file exists. This supposes that you create your letters, faxes, reports and the like in a numbered TeX-archive.
(filename prefixed with two hyphens):
they look for a TeX file using kpsewhich and let you edit it.
(filename prefixed with a single hyphen):
they look for a script script in $PATH and let you edit it.

The idea behind this script is laziness: I very often need to edit one of my many (mostly bash-)scripts or one of my archive files. Instead of trusting my memory to know where, in $PATH, the script is stored, I rather like this script to find it. And instead if typing, say, vi␣$ARCHIVE/1234/main.tex when I want to edit an archive file, I rather like to let this script type most of these characters.


Wybo Dekker


Released under the GNU General Public License