vi modeline -- another possible alternative, using tags

gbergman at ucbtopaz.UUCP gbergman at ucbtopaz.UUCP
Wed May 2 23:36:34 AEST 1984


ly put into that file 10 lines from the bottom (as
specified by the right-most part of the tag entry ``c'').  If I
don't happen to be in the editor, I can get in at that point using

	% vi -t c

If one keeps the entries of this file limited to items of current (or
perennial) importance, (for which purpose it helps to have a tag for
the tags file itself, as above) it can be extremely convenient.
     With this introduction, I leave it to you to learn about the
default value of the tabs setting (useful only if you have, and are
interested in, source-files for UNIX commands) and other details,
from the Ex Reference Manual, pointing out only that (1) the results can
be very confusing if you forget that tag entries must be alphabetized,
and (2) the syntax for specifying more than one tag file is

	:se tags=file1\ file2

     Now to the point: the rightmost item in a line of the tags-file
is an address-specification.  Though I seldom need anything more
sophisticated than 1 or $, the ``usual'' kind of specification (e.g.
in the default file) is a pattern-search, executed (with nomagic set)
as one enters the file.  Why not more generally allow it to be an
arbitrary   c o m m a n d    to be executed on entering the file?
     This would allow the same sort of file-tailored initialization
that ``modeline'' was set up for, but being specific to the user who
specifies the given tag file, it would not allow the kind of malicious
traps possible with modeline.

     As a nonhacker, I can't write the code; can one of you?

			George Bergman
			(preferred address: gbergman at ucbcartan;
			but I post from topaz.cc because
			ucbcartan doesn't subscribe to net.news)



More information about the Comp.unix.wizards mailing list