I know from experience that the ~/.exrc file can be used to configure vim
. I also know that the ~/.vimrc file can be used for the same purpose.
However, If I use .exrc to configure vim
, this leads to problems on systems where vi
is installed rather than vim
. Namely, vim
supports extra features that vi
does not; and when you try to use them in vi
, vi
complains.
My questions are:
- What is the difference between .exrc and .vimrc?
- If both are present, then are both used?
- Is it bad practice to use the .exrc file to configure
vim
?
Best Answer
.exrc is the configuration file for
vi
, whereas .vimrc is the config file forvim
No. Vim will use the .vimrc file if present, otherwise the .exrc file if present
Yes, unless you only put vi-compatible commands in there
From the Vim help on exrc: