Initialization
vi performs the following initialization steps:
If the
EXINIT
environment variable exists, execute the commands it contains. Separate multiple commands by a pipe symbol (|
).If
EXINIT
doesnât exist, look for the file $HOME/.exrc. If it exists, read and execute it.If either
EXINIT
or $HOME/.exrc turns on theexrc
option, read and execute the file ./.exrc, if it exists.Execute search or goto commands given with
+/
pattern
or+
n
command-line options (POSIX:-c
option).
The .exrc files are simple scripts of ex commands;
the commands in them donât need a
leading colon. You can put comments in your scripts by starting a line
with a double quote ("
). This is recommended.
Get vi and Vim Editors Pocket Reference, 2nd 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.