Re: $VIMRC over .vimrc ?
Christopher <[email protected]> Mon, 30 Mar 2026 12:57:18 -0700 (PDT)
| Newsgroups | gmane.editors.vim |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_312668_1464418793.1774900638892 Content-Type: multipart/alternative; boundary="----=_Part_312669_650641904.1774900638892" ------=_Part_312669_650641904.1774900638892 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Friday, March 20, 2026 at 10:58:21=E2=80=AFAM UTC-4 D. Ben Knoble wrote: On Fri, Mar 20, 2026 at 9:58=E2=80=AFAM Christopher <[email protected]>= wrote:=20 >=20 >=20 >=20 > On Thursday, March 19, 2026 at 8:44:22=E2=80=AFPM UTC-4 Marvin Renich wro= te:=20 >=20 > * Christopher <[email protected]> [260319 19:14]:=20 > > On Thu, Mar 19, 2026 at 9:45=E2=80=AFAM Marvin Renich <[email protected]= > wrote:=20 > > > The user's vimrc file _must_ be one of the files listed above, unless= =20 > > > you specify the -u option. The only way to specify the vimrc file in= =20 an=20 > > > environment variable is to export VIMINT=3D"source /path/to/your/vimr= c"=20 > > > before (or while) starting vim.=20 > >=20 > > You mention, the only way to specify a vimrc in a environment variable;= =20 I=20 > > assume as in $MYVIMRC is to export VIMNT which is the source of your=20 vimrc=20 > > file. If my vimrc file was located in the system path then that would= =20 be;=20 > > VIMINT=3D`/etc/vimrc and that would create the environment variable=20 $MYVIMRC=20 > > ?=20 >=20 > You need to read carefully and for exact syntax and content:=20 >=20 > > > environment variable is to export VIMINT=3D"source /path/to/your/vimr= c"=20 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^=20 >=20 > Remember that VIMINIT specifies an ex command to execute, not a file=20 > name. If you want to source a file using VIMINIT, you must specify the=20 > source command itself, not just the file name.=20 >=20 > Also, when testing this, know that :scriptnames is your friend.=20 >=20 > Also note that if your vimrc file is the system vimrc file (/etc/vimrc=20 > on some distributions, /etc/vim/vimrc on Debian), it is sufficient to=20 > use:=20 >=20 > VIMINIT=3D':' vim=20 >=20 > or=20 >=20 > export VIMINIT=3D':'=20 > vim=20 >=20 > as the system vimrc is sourced even if you specify a VIMINIT. Setting=20 > VIMINIT=3D':' simply disables reading of the user vimrc file, but not the= =20 > system vimrc file. (':' is an empty ex command.)=20 >=20 > Finally, if you specify VIMINIT, MYVIMRC is _not_ set by vim.=20 >=20 > ...Marvin=20 >=20 >=20 > What do you mean by :scriptnames ?=20 ":scriptnames" is an Ex command supported by Vim that announces what=20 scripts have been executed in the current session. (":help=20 :scriptnames").=20 > Within vim I run the command; VIMIT=3D: (colon) and that takes my system= =20 vimrc assigns it the variable $MYVIMRC or that has to be done after ?=20 I get the sense you may not be reading very carefully, but let me try=20 to clear up some confusion:=20 - "VIMINIT=3D: vim" is an example shell command that would disable=20 initializations from vimrc files other than the system vimrc.=20 (Notably, this does _not_ disable user-local plugins.)=20 - Vim will assign MYVIMRC if and when it finds and executes a user=20 vimrc. It never (AFAIK) assigns MYVIMRC to the path of the system=20 vimrc.=20 - The above point is moot if you set VIMINIT; then nothing sets MYVIMRC=20 - MYVIMRC is never _read_ by Vim to take any action (unless a plugin=20 or script uses it)=20 I wanted to clarify that it's now clear. In order to use the environment=20 variable *$MYVIMRC* you must have a *user*; *.vimrc* file created,=20 typically at the $HOME path for the installed nix version. --=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/0ab= 878b1-afba-4524-913b-5ffe79587c76n%40googlegroups.com. ------=_Part_312669_650641904.1774900638892 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <br /><br /><div><div dir=3D"auto">On Friday, March 20, 2026 at 10:58:21=E2= =80=AFAM UTC-4 D. Ben Knoble wrote:<br /></div><blockquote style=3D"margin:= 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left= : 1ex;">On Fri, Mar 20, 2026 at 9:58=E2=80=AFAM Christopher <<a href=3D"= " rel=3D"nofollow">[email protected]</a>> wrote: <br />> <br />> <br />> <br />> On Thursday, March 19, 2026 at 8:44:22=E2=80=AFPM UTC-4 Marvin R= enich wrote: <br />> <br />> * Christopher <<a href=3D"" rel=3D"nofollow">crestchr...@gmai= l.com</a>> [260319 19:14]: <br />> > On Thu, Mar 19, 2026 at 9:45=E2=80=AFAM Marvin Renich <<= a href=3D"" rel=3D"nofollow">[email protected]</a>> wrote: <br />> > > The user's vimrc file _must_ be one of the files liste= d above, unless <br />> > > you specify the -u option. The only way to specify the= vimrc file in an <br />> > > environment variable is to export VIMINT=3D"source /pa= th/to/your/vimrc" <br />> > > before (or while) starting vim. <br />> > <br />> > You mention, the only way to specify a vimrc in a environme= nt variable; I <br />> > assume as in $MYVIMRC is to export VIMNT which is the sourc= e of your vimrc <br />> > file. If my vimrc file was located in the system path then = that would be; <br />> > VIMINT=3D`/etc/vimrc and that would create the environment = variable $MYVIMRC <br />> > ? <br />> <br />> You need to read carefully and for exact syntax and content: <br />> <br />> > > environment variable is to export VIMINT=3D"source /pa= th/to/your/vimrc" <br />> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <br />> <br />> Remember that VIMINIT specifies an ex command to execute, not a = file <br />> name. If you want to source a file using VIMINIT, you must speci= fy the <br />> source command itself, not just the file name. <br />> <br />> Also, when testing this, know that :scriptnames is your friend. <br />> <br />> Also note that if your vimrc file is the system vimrc file (/etc= /vimrc <br />> on some distributions, /etc/vim/vimrc on Debian), it is sufficie= nt to <br />> use: <br />> <br />> VIMINIT=3D':' vim <br />> <br />> or <br />> <br />> export VIMINIT=3D':' <br />> vim <br />> <br />> as the system vimrc is sourced even if you specify a VIMINIT. Se= tting <br />> VIMINIT=3D':' simply disables reading of the user vimrc file, bu= t not the <br />> system vimrc file. (':' is an empty ex command.) <br />> <br />> Finally, if you specify VIMINIT, MYVIMRC is _not_ set by vim. <br />> <br />> ...Marvin <br />> <br />> <br />> What do you mean by :scriptnames ? <br /> <br />":scriptnames" is an Ex command supported by Vim that announces what <br />scripts have been executed in the current session. (":help <br />:scriptnames"). <br /> <br />> Within vim I run the command; VIMIT=3D: (colon) and that takes m= y system vimrc assigns it the variable $MYVIMRC or that has to be done afte= r ? <br /> <br />I get the sense you may not be reading very carefully, but let me try <br />to clear up some confusion: <br /> <br />- "VIMINIT=3D: vim" is an example shell command that would disable <br />initializations from vimrc files other than the system vimrc. <br />(Notably, this does _not_ disable user-local plugins.) <br />- Vim will assign MYVIMRC if and when it finds and executes a user <br />vimrc. It never (AFAIK) assigns MYVIMRC to the path of the system <br />vimrc. <br />- The above point is moot if you set VIMINIT; then nothing sets MYVIM= RC <br />- MYVIMRC is never _read_ by Vim to take any action (unless a plugin <br />or script uses it) <br /></blockquote><div><br /></div><div>I wanted to clarify that it's now = clear. In order to use the environment variable <b>$MYVIMRC</b> you must ha= ve a <i>user</i>; <i>.vimrc</i> file created, typically at the $HOME path f= or the installed nix version.</div></div> <p></p> -- <br /> -- <br /> You received this message from the "vim_use" 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" 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/0ab878b1-afba-4524-913b-5ffe79587c76n%40googlegroups.com?utm_medium= =3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/vim_use/0ab= 878b1-afba-4524-913b-5ffe79587c76n%40googlegroups.com</a>.<br /> ------=_Part_312669_650641904.1774900638892-- ------=_Part_312668_1464418793.1774900638892--