Xref: utzoo comp.unix.misc:668 comp.unix.questions:27348 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!chaph.usc.edu!alcor.usc.edu!jeenglis From: jeenglis@alcor.usc.edu (Joe English Muffin) Newsgroups: comp.unix.misc,comp.unix.questions Subject: Re: A question on .exrc while using vi Keywords: exrc vi Message-ID: <13458@chaph.usc.edu> Date: 4 Dec 90 05:01:49 GMT References: <5315@graphite20.UUCP> Sender: news@chaph.usc.edu Followup-To: comp.unix.misc Organization: USC Co-Ed Naked Depressed Person's Softball League Lines: 26 Nntp-Posting-Host: alcor.usc.edu joshi@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@alcor.usc.edu