Re: $VIMRC over .vimrc ?

"D. Ben Knoble" <[email protected]> Fri, 20 Mar 2026 10:57:56 -0400
Newsgroups gmane.editors.vim
Message-ID <CALnO6CC33KPvhAc06k-WzcMcgvsff9mCyxjb7c4EsDKqDRr=Ow@mail.gmail.com>
On Fri, Mar 20, 2026 at 9:58=E2=80=AFAM Christopher <crestchristopher@gmail=
.com> wrote:
>
>
>
> On Thursday, March 19, 2026 at 8:44:22=E2=80=AFPM UTC-4 Marvin Renich wro=
te:
>
> * Christopher <[email protected]> [260319 19:14]:
> > On Thu, Mar 19, 2026 at 9:45=E2=80=AFAM Marvin Renich <[email protected]=
> wrote:
> > > The user's vimrc file _must_ be one of the files listed above, unless
> > > you specify the -u option. The only way to specify the vimrc file in =
an
> > > environment variable is to export VIMINT=3D"source /path/to/your/vimr=
c"
> > > before (or while) starting vim.
> >
> > You mention, the only way to specify a vimrc in a environment variable;=
 I
> > assume as in $MYVIMRC is to export VIMNT which is the source of your vi=
mrc
> > file. If my vimrc file was located in the system path then that would b=
e;
> > VIMINT=3D`/etc/vimrc and that would create the environment variable $MY=
VIMRC
> > ?
>
> You need to read carefully and for exact syntax and content:
>
> > > environment variable is to export VIMINT=3D"source /path/to/your/vimr=
c"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Remember that VIMINIT specifies an ex command to execute, not a file
> name. If you want to source a file using VIMINIT, you must specify the
> source command itself, not just the file name.
>
> Also, when testing this, know that :scriptnames is your friend.
>
> Also note that if your vimrc file is the system vimrc file (/etc/vimrc
> on some distributions, /etc/vim/vimrc on Debian), it is sufficient to
> use:
>
> VIMINIT=3D':' vim
>
> or
>
> export VIMINIT=3D':'
> vim
>
> as the system vimrc is sourced even if you specify a VIMINIT. Setting
> VIMINIT=3D':' simply disables reading of the user vimrc file, but not the
> system vimrc file. (':' is an empty ex command.)
>
> Finally, if you specify VIMINIT, MYVIMRC is _not_ set by vim.
>
> ...Marvin
>
>
> What do you mean by :scriptnames ?

":scriptnames" is an Ex command supported by Vim that announces what
scripts have been executed in the current session. (":help
:scriptnames").

> Within vim I run the command; VIMIT=3D: (colon) and that takes my system =
vimrc assigns it the variable $MYVIMRC or that has to be done after ?

I get the sense you may not be reading very carefully, but let me try
to clear up some confusion:

- "VIMINIT=3D: vim" is an example shell command that would disable
initializations from vimrc files other than the system vimrc.
(Notably, this does _not_ disable user-local plugins.)
- Vim will assign MYVIMRC if and when it finds and executes a user
vimrc. It never (AFAIK) assigns MYVIMRC to the path of the system
vimrc.
- The above point is moot if you set VIMINIT; then nothing sets MYVIMRC
- MYVIMRC is never _read_ by Vim to take any action (unless a plugin
or script uses it)

--=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/CAL=
nO6CC33KPvhAc06k-WzcMcgvsff9mCyxjb7c4EsDKqDRr%3DOw%40mail.gmail.com.