Skip to main content
deleted 8 characters in body; deleted 50 characters in body; deleted 2 characters in body
Source Link
Feng Yu
  • 659
  • 5
  • 17

ClearedClear $VIMINIT:

I launched vim and trief :scriptnames again, .vimrc wasProblem still not sourcedexist.

Cleared $VIMINIT:

I launched vim and trief :scriptnames again, .vimrc was still not sourced.

Clear $VIMINIT:

Problem still exist.

added 19 characters in body
Source Link
muru
  • 25.1k
  • 8
  • 83
  • 144

Today, I found my .vimrc didn't take effect, it is. It was ok just hours ago.

When launchI launched vim with $vim --plugin, :scriptnames echoechoed nothing: .vimrc file iswas not sourced. (Note: /etc/vimrc was removed to debug this problem.)

Then I tried to google and findfound $VIMINIT variable looks suspicious.

Vim documentdocumentation about 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 (*)!
 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 (*)!

I could not understand the vim documentdocumentation fully,. It seems that $VIMINIT may mess the startup of vim.

ClearCleared $VIMINIT:

LaunchI launched vim and trytrief :scriptnames again, .vimrc was still not sourced.

Today I found my .vimrc didn't take effect, it is ok just hours ago.

When launch vim with $vim --plugin, :scriptnames echo nothing: .vimrc file is not sourced. (Note: /etc/vimrc was removed to debug this problem.)

Then I tried to google and find $VIMINIT variable looks suspicious.

Vim document about 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 (*)!

I could not understand the vim document fully, It seems that $VIMINIT may mess the startup of vim.

Clear $VIMINIT:

Launch vim and try :scriptnames again, .vimrc was still not sourced.

Today, I found my .vimrc didn't take effect. It was ok just hours ago.

When I launched vim with $vim --plugin, :scriptnames echoed nothing: .vimrc file was not sourced. (Note: /etc/vimrc was removed to debug this problem.)

Then I tried to google and found $VIMINIT variable suspicious.

Vim documentation about 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 (*)!

I could not understand the vim documentation fully. It seems that $VIMINIT may mess the startup of vim.

Cleared $VIMINIT:

I launched vim and trief :scriptnames again, .vimrc was still not sourced.

Source Link
Feng Yu
  • 659
  • 5
  • 17

Why won't vim source my .vimrc file

Today I found my .vimrc didn't take effect, it is ok just hours ago.

When launch vim with $vim --plugin, :scriptnames echo nothing: .vimrc file is not sourced. (Note: /etc/vimrc was removed to debug this problem.)

Then I tried to google and find $VIMINIT variable looks suspicious.

Here is the value of $VIMINIT:

$ echo $VIMINIT
set number

Vim document about 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 (*)!

I could not understand the vim document fully, It seems that $VIMINIT may mess the startup of vim.

Clear $VIMINIT:

$ VIMINIT=
$ echo $VIMINIT

Launch vim and try :scriptnames again, .vimrc was still not sourced.