Interesting vi bug/feature

Mark Horton mark at cbosgd.UUCP
Sun Dec 9 16:01:59 AEST 1984


In article <1705 at umcp-cs.UUCP> chris at umcp-cs.UUCP (Chris Torek) writes:
>It may either be considered a bug or a feature that running ``vi''
>in your home directory causes it to read your .exrc twice.

This is true.  What really happens is that if you don't have an EXINIT
in your environment, vi sources ~/.exrc and also ./.exrc, in case you
have local options for the current directory.  If you're in your home
directory, it will source the same file twice.

If you have an EXINIT in your environment instead of a ~/.exrc file,
you won't have this problem.  Since .exrc files have other problems
(speed and funny characters like ^D stripped) it is strongly recommended
that you use EXINIT instead of ~/.exrc.

Since .exrc and EXINIT normally contain set and map and abbr commands,
it's usually harmless for the .exrc file to be sourced twice.



More information about the Comp.bugs.4bsd.ucb-fixes mailing list