On Do, 19 Mär 2026, Gary Johnson wrote:

> That's what I used to think, too, was that MYVIMRC was set, but not
> read, by Vim.  But ":help MYVIMRC" says this:
> 
>                       *$MYVIMRC* *$MYVIMDIR*
>      c. Five 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
>       when using VIMINIT.  ...
> 
> It's that "unless `$MYVIMRC was already set" that I don't understand
> the meaning of.  That suggests to me if $MYVIMRC is already set, Vim
> uses that value instead of looking further for the file.
> 
> In my experiments, I executed
> 
>     VIMINIT='let $MYVIMRC="/path/to/a/vimrc"' vim
> 
> expecting Vim to source /path/to/a/vimrc, but it didn't.  I'm OK
> with the actual behavior, but I don't think the documentation is
> clear.

I understand this that Vim won't overwrite your $MYVIMRC environment 
variable, if for whatever reason it already exists when starting Vim. It 
doesn't mean it will use this value of this environment variable as an 
init file that it should actually read.

Thanks,
Christian
-- 
God made the world in six days, and was arrested on the seventh.

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_use/abv3hXDtGRarmEsp%40256bit.org.

Reply via email to