Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!bu-cs!buengc!bph From: bph@buengc.BU.EDU (Blair P. Houghton) Newsgroups: comp.unix.questions Subject: Re: Two vi questions. Message-ID: <4248@buengc.BU.EDU> Date: 19 Sep 89 22:07:33 GMT References: <20884@adm.BRL.MIL> Reply-To: bph@buengc.bu.edu (Blair P. Houghton) Followup-To: comp.unix.questions Organization: Boston Univ. Col. of Eng. Lines: 43 In article <20884@adm.BRL.MIL> rbj@dsys.ncsl.nist.gov (Root Boy Jim) writes: >? From: "Blair P. Houghton" > >? No, it's ME I need to fix. > >? if ( $?prompt ) then >? set prompt="subwhat? " >? else >? unset prompt >? endif > >The else clause is unnecessary. The else-clause shown is degenerate for the purposes of the example. The one I use has more than an unset in it. >Also, you might as well simply exit I especially dislike using 'exit' as a conditional structure. I reserve it for error conditions. >your .cshrc at this point, as you most likely don't want any aliases >or variables set. The general form of .cshrc should be: > > > if ($?prompt == 0) exit > But, I shell-out of vi(1andonly) all the time. If for instance I'm editing some C and want to go take a fast look at a header file, I'll just :!m $INC/stdio.h Which requires that I have the aliasing rerun, and set INC to /usr/include. Further, I don't even set the variable INC unless I'm inside vi(1forall) and shelling out noninteractively. Any other time the extra bit of typing won't bother me. --Blair "Still running fine since the tune-up."