Learning the vi Editor

Learning the vi EditorSearch this book
Previous: 9.3 Online Help and Other DocumentationChapter 9
nvi -- New vi
Next: 9.5 Multiwindow Editing
 

9.4 Initialization

If the -s or "-" options have been specified, then nvi will bypass all initializations. Otherwise, nvi performs the following steps:

  1. Read and execute the file /etc/vi.exrc. It must be owned either by root or by you.

  2. Execute the value of the NEXINIT environment variable if it exists, otherwise use EXINIT if it exists. Only one will be used, not both. Bypass executing $HOME/.nexrc or $HOME/.exrc.

  3. If $HOME/.nexrc exists, read and execute it. Otherwise, if $HOME/.exrc exists, read and execute it. Only one will be used.

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


Previous: 9.3 Online Help and Other DocumentationLearning the vi EditorNext: 9.5 Multiwindow Editing
9.3 Online Help and Other DocumentationBook Index9.5 Multiwindow Editing

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System