Humor: Cargo Cult Programming

Kevin D. Clark kclark at CetaceanNetworks.com
Thu Nov 14 21:29:24 EST 2002


mod+gnhlug at std.com (Michael O'Donnell) writes:

> As I've said before, I suspect that emacs- and
> perl-users are actually the higher life forms;

Well, that isn't true...

[snip]
> 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.

You can accomplish this in emacs by running C-u M-C-| on a region.

I write a *lot* of code this way.

> 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.

Yes, I use this feature in vi a lot (I use vi a lot too).

I have to say that I like the fact that vim seems to have different
behavior than all of the old vi implementations that I've used in the
past.  For example, if I define a mark, move,  and then
        
        :'a,.! perl -pe '...'

the mark is preserved.  I mean, when vi loses the mark after this
operation and I want to run another command, I want to scream.

OTOH, the fact that vi and vim seem to treat some characters as
"magical" (like '#' and especially '%') really louses me up sometimes,
at which point I scramble back to emacs.

(I can't :'a,.! perl -pe 's/^/#/' in vim, for example)

Regards,

--kevin
-- 
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc




More information about the gnhlug-discuss mailing list