[comp.editors] vi .exrc files

s887212@minyos.xx.rmit.oz (Stephen Riehm [Romulis]) (10/12/90)

Is there any way of getting vi to  :-
a> re-read its .exrc
b> read its .exrc file from a different directory??

also if anyone has any hints on setting up vi (yes we have a relatively
decent one which even has ex commands and :set etc etc) on an IBM/Novell
network I would be most gratefull for any news from people who have
encountered (and maybe conquered?) the problems incurred with vi and mapped
user directories.

much thanx in advance
============================================================================
Romulis [Stephen Riehm]	            Royal Melbourne Institute of Technology,
					       (124 Latrobe St., Melbourne.)
s887212@minyos.xx.rmit.oz.au					   Australia.

@>---`--,--( Still Stuck on the wrong side of the deep pink sea )--.--'---<@
======================< Insert Usual Disclaimer >===========================

steinbac@hpl-opus.HP.COM (Gunter Steinbach) (10/13/90)

Use 

:so filename

to source any .exrc- type file you like, i.e. to interpret that file as
containing ex commands.  It's in the manual.

	 Guenter Steinbach		gunter_steinbach@hplabs.hp.com

rob@b15.INGR.COM (Rob Lemley) (10/19/90)

In <6009@minyos.xx.rmit.oz> s887212@minyos.xx.rmit.oz (Stephen Riehm [Romulis]) writes:

>Is there any way of getting vi to  :-

>b> read its .exrc file from a different directory??

On system V release 3 UNIX, vi will read the $HOME/.exrc file first,
then the .exrc file in the current directory.
--
-Rob Lemley                                                 205-730-1546
 System Consultant, Scanning Software, Intergraph, Huntsville, AL

jeff@cjsa.wa.com (Jeffery Small) (10/23/90)

rob@b15.INGR.COM (Rob Lemley) writes:

>In <6009@minyos.xx.rmit.oz> (Stephen Riehm [Romulis]) writes:
>>Is there any way of getting vi to  :-
>>b> read its .exrc file from a different directory??

>On system V release 3 UNIX, vi will read the $HOME/.exrc file first,
>then the .exrc file in the current directory.
>
>-Rob Lemley                                                 205-730-1546
> System Consultant, Scanning Software, Intergraph, Huntsville, AL

If set, vi will first attempt to use the environment variable $EXINIT before
resorting to the .exrc file(s).

Depending upon what I am logged into and where (which machine) I am currently
on, I want to use a different vi initialization file.  (I use this scheme to
try and set every keyboard I work on to function in a similar manner.)  I keep
a set of vi initialization files in the directory $HOME/.misc such as:

	$HOME/.misc/.exrcSUN
	$HOME/.misc/.exrc3B1
	$HOME/.misc/.exrcWY75
	$HOME/.misc/.exrcVT100
	etc.

Here is a skeleton outline from my $HOME/.profile which shows how these files
can be used.  This should give you the general idea of how to set things up.
This scheme has worked just fine for me.  In addition to use in .profile, you
can of course also set and use the EXINIT variable interactively.

Note:  'so' is the ex source command which says to execute the ex commands
	in the named file.


# $HOME/.profile
	...
EDITOR=/usr/bin/vi
	...
case `tty` in
/dev/w*|/dev/syscon)
    EXINIT='so $HOME/.misc/.exrc3B1' ; export EXINIT ;;
/dev/ttyp*)
    case $TERM in
    s4|unixpc)
	EXINIT='so $HOME/.misc/.exrc3B1' ; export EXINIT ;;
    sun)
	EXINIT='so $HOME/.misc/.exrcSUN' ; export EXINIT ;;
    wy75)
	EXINIT='so $HOME/.misc/.exrcWY75' ; export EXINIT ;;
    vt100)
	EXINIT='so $HOME/.misc/.exrcVT100' ; export EXINIT ;;
    *)
	echo ".profile:  Unrecognized terminal type <${TERM}>."
	;;
    esac
    ;;
/dev/tty001)
    EXINIT='so $HOME/.misc/.exrcWY75' ; export EXINIT ;;
/dev/tty002)
    EXINIT='so $HOME/.misc/.exrc3B1' ; export EXINIT ;;
*)
    echo ".profile:  Unrecognized login port <`tty`>." ;;
esac