Hoy, descubrí que mi .vimrc
no tuvo efecto. Estaba bien hace solo unas horas.
Cuando lancé vim con $vim --plugin
, :scriptnames
no se hizo eco de nada: el .vimrc
archivo no tenía origen. (Nota: /etc/vimrc
se eliminó para depurar este problema).
Luego intenté googlear y encontré $VIMINIT
variables sospechosas.
Aquí está el valor de $VIMINIT
:
$ echo $VIMINIT
set number
Documentación de Vim sobre VIMINIT
:
c. Four places are searched for initializations. The first that exists
is used, the others are ignored. The $MYVIMRC environment variable is
set to the file that was first found, unless $MYVIMRC was already set.
- The environment variable VIMINIT (see also |compatible-default|) (*)
The value of $VIMINIT is used as an Ex command line.
- The user vimrc file(s):
"$HOME/.vimrc" (for Unix and OS/2) (*)
"s:.vimrc" (for Amiga) (*)
"home:.vimrc" (for Amiga) (*)
"$VIM/.vimrc" (for OS/2 and Amiga) (*)
"$HOME/_vimrc" (for MS-DOS and Win32) (*)
"$VIM/_vimrc" (for MS-DOS and Win32) (*)
Note: For Unix, OS/2 and Amiga, when ".vimrc" does not exist,
"_vimrc" is also tried, in case an MS-DOS compatible file
system is used. For MS-DOS and Win32 ".vimrc" is checked
after "_vimrc", in case long file names are used.
Note: For MS-DOS and Win32, "$HOME" is checked first. If no
"_vimrc" or ".vimrc" is found there, "$VIM" is tried.
See |$VIM| for when $VIM is not set.
- The environment variable EXINIT.
The value of $EXINIT is used as an Ex command line.
- The user exrc file(s). Same as for the user vimrc file, but with
"vimrc" replaced by "exrc". But only one of ".exrc" and "_exrc" is
used, depending on the system. And without the (*)!
No pude entender la documentación de vim completamente. Parece que $VIMINIT
puede estropear el inicio de vim.
Claro $VIMINIT
:
$ VIMINIT=
$ echo $VIMINIT
El problema aún existe.
$VIMINIT
tiene precedente sobre cualquier.vimrc
archivo. Y satisface la regla de orden de llegada. Entonces sí.vimrc
se ignora.