Re: $VIMRC over .vimrc ?

Christopher <[email protected]> Thu, 19 Mar 2026 00:59:13 -0700 (PDT)
Newsgroups gmane.editors.vim
Message-ID <[email protected]>
------=_Part_68068_1609011139.1773907153005
Content-Type: multipart/alternative; 
	boundary="----=_Part_68069_630936943.1773907153005"

------=_Part_68069_630936943.1773907153005
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



On Thursday, March 19, 2026 at 3:01:12=E2=80=AFAM UTC-4 Igbanam Ogbuluijah =
wrote:

On Wed, Mar 18, 2026 at 10:12:49PM +0000, Gary Johnson wrote:=20
> On 2026-03-18, Eric Marceau wrote:=20
> > I did a little experiment:=20
>=20
> [...]=20
>=20
> I did something similar with terminal vim. I set MYVIMRC directly=20
> in my environment and set it in VIMINIT, also in my environment,=20
> before starting vim. In all cases, I could see both environment=20
> variables within vim and in the environment after shelling out of=20
> vim, but in no case was there any evidence of those variables=20
> affecting the vimrc sourced by vim at startup. The $MYVIMRC file=20
> did not appear in the output of :scriptnames and none of the=20
> settings made in that file were set in vim. The only vimrc sourced=20
> was the system vimrc, /etc/vim/vimrc on Ubuntu.=20
>=20
> It does seem like something is broken, because from vim's=20
> documentation, I would have expected the file specified by MYVIMRC=20
> to have been sourced.=20
>=20
> Regards,=20
> Gary=20
>=20
> --=20
> --=20
> You received this message from the "vim_use" maillist.=20
> Do not top-post! Type your reply below the text you are replying to.=20
> For more information, visit http://www.vim.org/maillist.php=20
>=20
> ---=20
> You received this message because you are subscribed to the Google Groups=
=20
"vim_use" group.=20
> To unsubscribe from this group and stop receiving emails from it, send an=
=20
email to [email protected].=20
> To view this discussion visit=20
https://groups.google.com/d/msgid/vim_use/20260319051249.GC10946%40phoenix.=
=20

It's not that something's broken; but there definitely is some=20
misconception.=20

What I think is going on is=E2=80=A6=20

1. The top two places Vim searches for configuration are=20
a. a VIMINIT environment variable=20
b. Some VIMRC file=20
2. You can set an environment variable, VIMINIT; it should have Ex=20
commands in it.=20
3. If there's no VIMINIT, Vim searches some predefined paths to set=20
VIMRC.=20

I don't think VIMRC is an env variable Vim respects; I think it's an env=20
variable it sets based on where it finds a vimrc file.=20


~ Igbanam=20


These are the paths Vim looks for configuration files.

system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"=20

In the documentation it states as mentioned above VIMINIT, also $MYVIMRC.=
=20
This last part I will have to bring clarity too.=20

--=20
--=20
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

---=20
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 e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_use/e84=
dc9e9-0831-4de2-a5d2-33aed9dbed5dn%40googlegroups.com.

------=_Part_68069_630936943.1773907153005
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<br /><br /><div><div dir=3D"auto">On Thursday, March 19, 2026 at 3:01:12=
=E2=80=AFAM UTC-4 Igbanam Ogbuluijah wrote:<br /></div><blockquote style=3D=
"margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padd=
ing-left: 1ex;">On Wed, Mar 18, 2026 at 10:12:49PM +0000, Gary Johnson wrot=
e:
<br />&gt; On 2026-03-18, Eric Marceau wrote:
<br />&gt; &gt; I did a little experiment:
<br />&gt;=20
<br />&gt; [...]
<br />&gt;=20
<br />&gt; I did something similar with terminal vim.  I set MYVIMRC direct=
ly
<br />&gt; in my environment and set it in VIMINIT, also in my environment,
<br />&gt; before starting vim.  In all cases, I could see both environment
<br />&gt; variables within vim and in the environment after shelling out o=
f
<br />&gt; vim, but in no case was there any evidence of those variables
<br />&gt; affecting the vimrc sourced by vim at startup.  The $MYVIMRC fil=
e
<br />&gt; did not appear in the output of :scriptnames and none of the
<br />&gt; settings made in that file were set in vim.  The only vimrc sour=
ced
<br />&gt; was the system vimrc, /etc/vim/vimrc on Ubuntu.
<br />&gt;=20
<br />&gt; It does seem like something is broken, because from vim's
<br />&gt; documentation, I would have expected the file specified by MYVIM=
RC
<br />&gt; to have been sourced.
<br />&gt;=20
<br />&gt; Regards,
<br />&gt; Gary
<br />&gt;=20
<br />&gt; --=20
<br />&gt; --=20
<br />&gt; You received this message from the "vim_use" maillist.
<br />&gt; Do not top-post! Type your reply below the text you are replying=
 to.
<br />&gt; For more information, visit <a href=3D"http://www.vim.org/mailli=
st.php" target=3D"_blank" rel=3D"nofollow">http://www.vim.org/maillist.php<=
/a>
<br />&gt;=20
<br />&gt; ---=20
<br />&gt; You received this message because you are subscribed to the Goog=
le Groups "vim_use" group.
<br />&gt; To unsubscribe from this group and stop receiving emails from it=
, send an email to <a href=3D"" rel=3D"nofollow">vim_use+u...@googlegroups.=
com</a>.
<br />&gt; To view this discussion visit <a href=3D"https://groups.google.c=
om/d/msgid/vim_use/20260319051249.GC10946%40phoenix" target=3D"_blank" rel=
=3D"nofollow">https://groups.google.com/d/msgid/vim_use/20260319051249.GC10=
946%40phoenix</a>.
<br />
<br />It's not that something's broken; but there definitely is some
<br />misconception.
<br />
<br />What I think is going on is=E2=80=A6
<br />
<br />1. The top two places Vim searches for configuration are
<br />  a. a VIMINIT environment variable
<br />  b. Some VIMRC file
<br />2. You can set an environment variable, VIMINIT; it  should have Ex
<br />commands in it.
<br />3. If there's no VIMINIT, Vim searches some predefined paths to set
<br />VIMRC.
<br />
<br />I don't think VIMRC is an env variable Vim respects; I think it's an =
env
<br />variable it sets based on where it finds a vimrc file.
<br />
<br />
<br />~ Igbanam
<br /></blockquote><div><br /></div><div>These are the paths Vim looks for =
configuration files.</div><div><br /></div><div>system vimrc file: "/etc/vi=
mrc"<br />=C2=A0 =C2=A0 =C2=A0user vimrc file: "$HOME/.vimrc"<br />=C2=A02n=
d user vimrc file: "~/.vim/vimrc"<br />=C2=A0 =C2=A0 =C2=A0 user exrc file:=
 "$HOME/.exrc"<br />=C2=A0 =C2=A0 =C2=A0 =C2=A0defaults file: "$VIMRUNTIME/=
defaults.vim"<br />=C2=A0 fall-back for $VIM: "/usr/share/vim"=C2=A0</div><=
div><br /></div><div>In the documentation it states as mentioned above VIMI=
NIT, also $MYVIMRC. This last part I will have to bring clarity too.=C2=A0<=
/div></div>

<p></p>

-- <br />
-- <br />
You received this message from the &quot;vim_use&quot; maillist.<br />
Do not top-post! Type your reply below the text you are replying to.<br />
For more information, visit <a href=3D"http://www.vim.org/maillist.php">htt=
p://www.vim.org/maillist.php</a><br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;vim_use&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">vim_use+uns=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
vim_use/e84dc9e9-0831-4de2-a5d2-33aed9dbed5dn%40googlegroups.com?utm_medium=
=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/vim_use/e84=
dc9e9-0831-4de2-a5d2-33aed9dbed5dn%40googlegroups.com</a>.<br />

------=_Part_68069_630936943.1773907153005--

------=_Part_68068_1609011139.1773907153005--