As I've said before, I suspect that emacs- and
perl-users are actually the higher life forms;
it's just that I don't know how to use them and so
keep falling back on vi and the other tools that I
already know...

As a general answer to pll's queries: vi can't
necessarily do all the goofy things that emacs can
do, but it is surprisingly powerful.  And I'm just
talking about "plain old" vi; vim has tricks up its
sleeve that you'd never suspect.

If I had to name some of my favorite vi characteristics
I'd have to say its regular expression handling and
particularly its feed-specified-region-as-stdin-to-
arbitrary-program-and-replace-that-region-with-the-
resultant-stdout trick.  The latter means that you
can do anything with any text in any vi buffer that
you could do with any arbitrary program that processes
its stdin and spews something useful via its stdout.
Therefore, the answer to most of pll's queries is
"yes" (though YMMV) because you can sort, columnize,
reformat, etc, with programs like sort, cut, ls,
tbl, indent, fmt, etc.  And if there isn't already
a program that does what you want, you can write one.

For example, I wrote an awk script to do similar sorts
of tabularization trickery that somebody already
showed emacs to be capable of.  I must say, the
(results of) that emacs trick look prettier than mine,
but that just reflects the (lack of) effort I put
into that coding that script; it did what I needed.

The way you use the bufferStdinStdoutSubstitution
trick is to (A) specify the buffer and then (B)
inform vi which program to execute.  You accomplish
A by placing the cursor on a line and saying !
followed by any normal vi motion command.  vi will
then (B) invite you to say which program you'd like
the implied buffer to be fed to as stdin.  EXAMPLE:
Since saying } means goto-end-of-paragraph you can
reformat a paragraph (for example) by placing the
cursor on the first line of a paragraph and saying

   !}fmt -1 | sort -fdu | fmt -55

which means "feed this paragraph as stdin to the fmt
program and replace it with fmt's output"

 .

_______________________________________________
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss

Reply via email to