A question on .exrc while using vi

Joe English Muffin jeenglis at alcor.usc.edu
Tue Dec 4 16:01:49 AEST 1990


joshi at motcid.UUCP (Abhay B. Joshi) writes:
>
>I set up a .exrc in the current directory which looks like (2 lines):
>	:g/the/ s//an/g
>
>Now I tried to do a 'vi text-file', I got a coredump! About 10 times.
>Then I deleted the .exrc file and put the command in EXINIT.
>I got a coredump again. (No coredump if neither .exrc nor EXINIT exists)

Just a guess:  I think that vi executes all the commands
in .exrc BEFORE reading the file to be edited.  (Try leaving
blank lines in .exrc -- you'll get messages like "No lines
in the buffer" even when you specify a filename on the
command line.)

I'm not sure what your actual application is, but you're better
off mapping a macro to the substitute command.

More weirdness I just discovered: if there are blank lines in 
.exrc, 'vi .exrc' hangs completely.  This is under SunOS 4.1
on a Sun-3.


--Joe English

  jeenglis at alcor.usc.edu



More information about the Comp.unix.misc mailing list