Initialization
If the -s
or “-” options have been
specified, then nvi will bypass all
initializations. Otherwise, nvi
performs the following steps:
Read and execute the file /etc/vi.exrc. It must be owned either by
root
or by you.Execute the value of the
NEXINIT
environment variable if it exists; otherwise, useEXINIT
if it exists. Only one will be used, not both. Bypass executing $HOME/.nexrc or $HOME/.exrc.If $HOME/.nexrc exists, read and execute it. Otherwise, if $HOME/.exrc exists, read and execute it. Only one will be used.
If the
exrc
option has been set, then look for and execute either ./.nexrc if it exists, or ./.exrc. Only one will be used.
nvi will not execute any file that is writable by anyone other than the file’s owner.
The nvi documentation
suggests putting common initialization actions into your .exrc file (i.e., options and commands for
Unix vi), and having your .nexrc file execute :source .exrc
before or after the nvi-specific initializations.
Get Learning the vi and Vim Editors, 7th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.