Two vi questions.

Blair P. Houghton bph at buengc.BU.EDU
Wed Sep 20 08:07:33 AEST 1989


In article <20884 at adm.BRL.MIL> rbj at dsys.ncsl.nist.gov (Root Boy Jim) writes:
>? From: "Blair P. Houghton" <bph at buengc.bu.edu>
>
>? 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:
>
>	<stuff you always want to do>
>	if ($?prompt == 0) exit
>	<interactive stuff>

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



More information about the Comp.unix.questions mailing list