Wednesday, March 25, 2026

pattern syntax for match()

i would like to do the following operation:
let m = match( "foo" , "foo\|beep" )
however, i get no match. (m is (-1).)
what is the correct pattern syntax to enable this match?
i am running vim:
VIM - Vi IMproved 9.2 (2026 Feb 14, compiled Mar 25 2026 09:59:45)
Included patches: 1-240
Huge version with GTK3 GUI.

thanks.

--
s. cowles
scowles at sonic dot net
Key fingerprint = 6DEC FF05 6952 3967 BE66 1BBD 588D 8B40 EFB8 4AA2


--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/ca2d97a1-0097-72ab-6646-92670559e880%40sonic.net.

Monday, March 23, 2026

Re: issues posting to the dev list

On Mo, 23 Mär 2026, Eli the Bearded wrote:

> Someone in comp.editors is reporting that attempts to post to Vim Dev
> list (<vim_dev@googlegroups.com> and <vim-dev@vim.org>) are bouncing
> with Google errors:
>
> "We're writing to let you know that the group you tried to
> contact (vim_dev) may not exist, or you may not have permission
> to post messages to the group. A few more details on why you
> weren't able to post:
> * You might have spelled or formatted the group name incorrectly.
> * The owner of the group may have removed this group.
> * You may need to join the group before receiving permission to post.
> * This group may not be open to posting.
> If you have questions related to this or any other Google Group,
> visit the Help Center at https://groups.google.com/support/."
>
> Subscribing to the list works, but doesn't fix the problem.
>
> Anyone running that list and able to read/post to Usenet still?
>
> From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
> Newsgroups: comp.editors
> Subject: Vim mailing list
> Date: Sun, 22 Mar 2026 03:38:27 +0100
> Message-ID: <10pnkn3$2utmg$1@dont-email.me>
>
> I suggested the google version of the list address and don't have
> any other concrete suggestions.

I cannot see a member with that name or E-Mail address in either the
vim_use or vim_dev list. You can direct him to me, but my possibilities
are limited. Google groups is a free service but also has no real
support unfortunately.

Thanks,
Christian
--
Contestants have been briefed on some questions before the show.

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/acGsKh6BOvvUbClB%40256bit.org.

issues posting to the dev list

Someone in comp.editors is reporting that attempts to post to Vim Dev
list (<vim_dev@googlegroups.com> and <vim-dev@vim.org>) are bouncing
with Google errors:

"We're writing to let you know that the group you tried to
contact (vim_dev) may not exist, or you may not have permission
to post messages to the group. A few more details on why you
weren't able to post:
* You might have spelled or formatted the group name incorrectly.
* The owner of the group may have removed this group.
* You may need to join the group before receiving permission to post.
* This group may not be open to posting.
If you have questions related to this or any other Google Group,
visit the Help Center at https://groups.google.com/support/."

Subscribing to the list works, but doesn't fix the problem.

Anyone running that list and able to read/post to Usenet still?

From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.editors
Subject: Vim mailing list
Date: Sun, 22 Mar 2026 03:38:27 +0100
Message-ID: <10pnkn3$2utmg$1@dont-email.me>

I suggested the google version of the list address and don't have
any other concrete suggestions.

Elijah

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/4ffkVk4CDPzfYm%40panix5.panix.com.

Sunday, March 22, 2026

Re: Ctrl+PageUp in 9.2.0204

On 2026-03-20, Christian Brabandt wrote:
> On Fr, 20 M�r 2026, jazztickets wrote:
>
> > For me the issue is still happening in 9.2.209 on the terminals I've
> > tried: xterm, xfce, gnome console, gnome terminal. It is working
> > however on Konsole, which also worked in 9.2.204.
>
> Thanks, let me ping the author

Patch 9.2.0229 seems to have fixed it. Thanks!

Regards,
Gary

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/20260322222903.GG10946%40phoenix.

Friday, March 20, 2026

Re: Ctrl+PageUp in 9.2.0204

On Fr, 20 Mär 2026, jazztickets wrote:

> For me the issue is still happening in 9.2.209 on the terminals I've
> tried: xterm, xfce, gnome console, gnome terminal. It is working
> however on Konsole, which also worked in 9.2.204.

Thanks, let me ping the author

Thanks,
Christian
--
Term, holidays, term, holidays, till we leave school, and then work, work,
work till we die.
-- C. S. Lewis

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/ab3Ifyp3iTWBoIhQ%40256bit.org.

Re: Ctrl+PageUp in 9.2.0204

On Fri, Mar 20, 2026 at 3:33 PM Christian Brabandt <cblists@256bit.org> wrote:
>
>
> On Fr, 20 Mär 2026, Gary Johnson wrote:
>
> > On 2026-03-20, Gary Johnson wrote:
> > > On 2026-03-20, jazztickets wrote:
> > > > I'm using ctrl+PageUp/ctrl+PageDown to switch between tabs but after upgrading
> > > > to vim 9.2.0204 in Arch Linux, ctrl+PageUp no longer goes to the previous tab.
> > > > Instead it's sending ctrl+e and scrolling one line down. Tested with
> > > > xfce4-terminal and gnome's terminal. Do I need to change something in the
> > > > terminal?
> > >
> > > I can verify this on Ubuntu 24.04.4. I did a git bisect and found
> > > the difference (bug?) to have been introduced at patch 9.2.0192.
> > > This behavior is not affected by "k" in 'cpoptions'. I haven't
> > > looked into it further.
> >
> > I forgot to mention that the terminal I used was xterm version 403
> > and the desktop environment was GNOME 46.0.
> >
> > However, I discovered that the issue is not present in the latest
> > Vim, 9.2.209, when using GNOME Terminal version 3.52.0.
>
> Thanks for reporting, but it's not clear to me is this issue only
> present in xterm? Or is it resolved with latest master?

For me the issue is still happening in 9.2.209 on the terminals I've
tried: xterm,
xfce, gnome console, gnome terminal. It is working however on Konsole, which
also worked in 9.2.204.

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/CACRkbns1tMhnBEz2gVF1oGo%3DoOTwa0Wz01ivQaF1zTrO2OxZ_w%40mail.gmail.com.

Re: Ctrl+PageUp in 9.2.0204

On Fr, 20 Mär 2026, Gary Johnson wrote:

> On 2026-03-20, Gary Johnson wrote:
> > On 2026-03-20, jazztickets wrote:
> > > I'm using ctrl+PageUp/ctrl+PageDown to switch between tabs but after upgrading
> > > to vim 9.2.0204 in Arch Linux, ctrl+PageUp no longer goes to the previous tab.
> > > Instead it's sending ctrl+e and scrolling one line down. Tested with
> > > xfce4-terminal and gnome's terminal. Do I need to change something in the
> > > terminal?
> >
> > I can verify this on Ubuntu 24.04.4. I did a git bisect and found
> > the difference (bug?) to have been introduced at patch 9.2.0192.
> > This behavior is not affected by "k" in 'cpoptions'. I haven't
> > looked into it further.
>
> I forgot to mention that the terminal I used was xterm version 403
> and the desktop environment was GNOME 46.0.
>
> However, I discovered that the issue is not present in the latest
> Vim, 9.2.209, when using GNOME Terminal version 3.52.0.

Thanks for reporting, but it's not clear to me is this issue only
present in xterm? Or is it resolved with latest master?

Thanks,
Christian
--
Flugg's Law:
When you need to knock on wood is when you realize
that the world is composed of vinyl, naugahyde and aluminum.

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/ab28rhNqM957aQsd%40256bit.org.

Re: Ctrl+PageUp in 9.2.0204

On 2026-03-20, Gary Johnson wrote:
> On 2026-03-20, jazztickets wrote:
> > I'm using ctrl+PageUp/ctrl+PageDown to switch between tabs but after upgrading
> > to vim 9.2.0204 in Arch Linux, ctrl+PageUp no longer goes to the previous tab.
> > Instead it's sending ctrl+e and scrolling one line down. Tested with
> > xfce4-terminal and gnome's terminal. Do I need to change something in the
> > terminal?
>
> I can verify this on Ubuntu 24.04.4. I did a git bisect and found
> the difference (bug?) to have been introduced at patch 9.2.0192.
> This behavior is not affected by "k" in 'cpoptions'. I haven't
> looked into it further.

I forgot to mention that the terminal I used was xterm version 403
and the desktop environment was GNOME 46.0.

However, I discovered that the issue is not present in the latest
Vim, 9.2.209, when using GNOME Terminal version 3.52.0.

Regards,
Gary

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/20260320203046.GF10946%40phoenix.

Re: Ctrl+PageUp in 9.2.0204

On 2026-03-20, jazztickets wrote:
> I'm using ctrl+PageUp/ctrl+PageDown to switch between tabs but after upgrading
> to vim 9.2.0204 in Arch Linux, ctrl+PageUp no longer goes to the previous tab.
> Instead it's sending ctrl+e and scrolling one line down. Tested with
> xfce4-terminal and gnome's terminal. Do I need to change something in the
> terminal?

I can verify this on Ubuntu 24.04.4. I did a git bisect and found
the difference (bug?) to have been introduced at patch 9.2.0192.
This behavior is not affected by "k" in 'cpoptions'. I haven't
looked into it further.

--------------------------------------------------------------------
c4d212257d61f5c2a9cd919486288c747aaaa05d is the first bad commit
commit c4d212257d61f5c2a9cd919486288c747aaaa05d
Author: AstroSnail <astrosnail@protonmail.com>
Date: Tue Mar 17 21:24:43 2026 +0000

patch 9.2.0192: not correctly recognizing raw key codes

Problem: When "k" is excluded from cpoptions, vim should be able to
recognize raw key codes in mappings and replace them with
builtin codes (e.g. ^[OA is replaced with <Up>) so that
changing the builtin code also changes the mapping to match.
Currently, this only works properly if the builtin code does
not contain modifiers (e.g. @;*).
Solution: Teach find_term_bykeys how to recognize keys with modifiers
(AstroSnail).

fixes: #19182
closes: #19643

Signed-off-by: AstroSnail <astrosnail@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

src/term.c | 93 +++++++++++++++++++++++++++++++++++++-----
src/testdir/test_termcodes.vim | 20 +++++++++
src/version.c | 2 +
3 files changed, 104 insertions(+), 11 deletions(-)
--------------------------------------------------------------------

Regards,
Gary

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/20260320194659.GE10946%40phoenix.

Ctrl+PageUp in 9.2.0204

I'm using ctrl+PageUp/ctrl+PageDown to switch between tabs but after upgrading to vim 9.2.0204 in Arch Linux, ctrl+PageUp no longer goes to the previous tab. Instead it's sending ctrl+e and scrolling one line down. Tested with xfce4-terminal and gnome's terminal. Do I need to change something in the terminal?

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/a0d10bae-cc9b-4d7d-85ab-8da124ab1e3an%40googlegroups.com.

Re: $VIMRC over .vimrc ?

On Fri, Mar 20, 2026 at 9:58 AM Christopher <crestchristopher@gmail.com> wrote:
>
>
>
> On Thursday, March 19, 2026 at 8:44:22 PM UTC-4 Marvin Renich wrote:
>
> * Christopher <crestchr...@gmail.com> [260319 19:14]:
> > On Thu, Mar 19, 2026 at 9:45 AM Marvin Renich <mr...@renich.org> 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="source /path/to/your/vimrc"
> > > 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 vimrc
> > file. If my vimrc file was located in the system path then that would be;
> > VIMINT=`/etc/vimrc and that would create the environment variable $MYVIMRC
> > ?
>
> You need to read carefully and for exact syntax and content:
>
> > > environment variable is to export VIMINT="source /path/to/your/vimrc"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> 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=':' vim
>
> or
>
> export VIMINIT=':'
> vim
>
> as the system vimrc is sourced even if you specify a VIMINIT. Setting
> VIMINIT=':' 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=: (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=: 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)

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/CALnO6CC33KPvhAc06k-WzcMcgvsff9mCyxjb7c4EsDKqDRr%3DOw%40mail.gmail.com.

Re: $VIMRC over .vimrc ?



On Thursday, March 19, 2026 at 8:44:22 PM UTC-4 Marvin Renich wrote:
* Christopher <crestchr...@gmail.com> [260319 19:14]:
> On Thu, Mar 19, 2026 at 9:45 AM Marvin Renich <mr...@renich.org> 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="source /path/to/your/vimrc"
> > 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 vimrc
> file. If my vimrc file was located in the system path then that would be;
> VIMINT=`/etc/vimrc and that would create the environment variable $MYVIMRC
> ?

You need to read carefully and for exact syntax and content:

> > environment variable is to export VIMINT="source /path/to/your/vimrc"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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=':' vim

or

export VIMINIT=':'
vim

as the system vimrc is sourced even if you specify a VIMINIT. Setting
VIMINIT=':' 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 ?

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

 

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/93a47316-1060-4434-b330-d8b8b72e6595n%40googlegroups.com.

Thursday, March 19, 2026

Re: $VIMRC over .vimrc ?

* Christopher <crestchristopher@gmail.com> [260319 19:14]:
> On Thu, Mar 19, 2026 at 9:45 AM Marvin Renich <mr...@renich.org> 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="source /path/to/your/vimrc"
> > 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 vimrc
> file. If my vimrc file was located in the system path then that would be;
> VIMINT=`/etc/vimrc and that would create the environment variable $MYVIMRC
> ?

You need to read carefully and for exact syntax and content:

> > environment variable is to export VIMINT="source /path/to/your/vimrc"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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=':' vim

or

export VIMINIT=':'
vim

as the system vimrc is sourced even if you specify a VIMINIT. Setting
VIMINIT=':' 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

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/abyYWCKoex7z/GPU%40basil.wdw.

Re: $VIMRC over .vimrc ?



On Thursday, March 19, 2026 at 12:29:46 PM UTC-4 D. Ben Knoble wrote:
On Thu, Mar 19, 2026 at 9:45 AM Marvin Renich <mr...@renich.org> wrote:
>
> * Christopher <crestchr...@gmail.com> [260319 03:56]:
> > On Wednesday, March 18, 2026 at 3:48:41 PM UTC-4 Ben Knoble wrote:
> > I'm afraid your question isn't clear to me, but let's look at `:help
> > myvimrc`:
> >
> > 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
>
> and
>
> > when using VIMINIT. The `$MYVIMDIR` environment variable is
> > set to the personal 'rtp' directory, however it is not verified
> > that the directory actually exists.
> > I The environment variable VIMINIT (see also |compatible-default|) (*)
> > The value of $VIMINIT is used as an Ex command line.
> > II The user vimrc file(s):
> > "$HOME/.vimrc" (for Unix) (*)
> > "$HOME/.vim/vimrc" (for Unix) (*)
> > "$XDG_CONFIG_HOME/vim/vimrc" (for Unix) (*)
> > "s:.vimrc" (for Amiga) (*)
> > "home:.vimrc" (for Amiga) (*)
> > "home:vimfiles:vimrc" (for Amiga) (*)
> > "$VIM/.vimrc" (for Amiga) (*)
> > "$HOME/_vimrc" (for Win32) (*)
> > "$HOME/vimfiles/vimrc" (for Win32) (*)
> > "$VIM/_vimrc" (for Win32) (*)
> > "$HOME/config/settings/vim/vimrc" (for Haiku) (*)
>
> This quote is missing an important word, as shown above.
>
> Perhaps that word should be "or" rather than "and", but either way the
> meaning should be clear:
>
> If VIMINIT is set, it contains ex commands, vim does not search for or
> read any rc file, and MYVIMRC is not set.
>
> If VIMINIT is not set, vim searches for a file in the places listed
> above, and sets MYVIMRC to the file that was found and read.
>
> So, MYVIMRC is not an input to vim, it is how vim communicates to the
> user which file was found and read. If MYVIMRC is exported before
> invoking vim, it is ignored completely; it is neither read nor set.
>
> 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="source /path/to/your/vimrc"
> before (or while) starting vim.
>
> The strongly recommended way is to _not_ use VIMINT, and to place your
> vimrc file at ~/.vim/vimrc. VIMINIT is a compatibility holdover.
>
> ...Marvin

Indeed. This is what I meant to convey, and I apologize if my initial
reply was not clear on this point:

Vim sets MYVIMRC for the user, not the other way around!

--
D. Ben Knoble

> 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="source /path/to/your/vimrc"
> 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 vimrc file. If my vimrc file was located in the system path then that would be;
VIMINT=`/etc/vimrc and that would create the environment variable $MYVIMRC ? 

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/b3efd6e9-4d4f-4752-af97-2d5666abfd6en%40googlegroups.com.

Re: $VIMRC over .vimrc ?

* D. Ben Knoble <ben.knoble@gmail.com> [260319 12:29]:
> Indeed. This is what I meant to convey, and I apologize if my initial
> reply was not clear on this point:
>
> Vim sets MYVIMRC for the user, not the other way around!

What you were saying was clear to me, but it seemed like the OP was
still confused, so I tried to say it a different way.

...Marvin

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/abxJd/2VxlFsH%2BX8%40basil.wdw.

Re: $VIMRC over .vimrc ?

On Thu, Mar 19, 2026 at 9:45 AM Marvin Renich <mrvn@renich.org> wrote:
>
> * Christopher <crestchristopher@gmail.com> [260319 03:56]:
> > On Wednesday, March 18, 2026 at 3:48:41 PM UTC-4 Ben Knoble wrote:
> > I'm afraid your question isn't clear to me, but let's look at `:help
> > myvimrc`:
> >
> > 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
>
> and
>
> > when using VIMINIT. The `$MYVIMDIR` environment variable is
> > set to the personal 'rtp' directory, however it is not verified
> > that the directory actually exists.
> > I The environment variable VIMINIT (see also |compatible-default|) (*)
> > The value of $VIMINIT is used as an Ex command line.
> > II The user vimrc file(s):
> > "$HOME/.vimrc" (for Unix) (*)
> > "$HOME/.vim/vimrc" (for Unix) (*)
> > "$XDG_CONFIG_HOME/vim/vimrc" (for Unix) (*)
> > "s:.vimrc" (for Amiga) (*)
> > "home:.vimrc" (for Amiga) (*)
> > "home:vimfiles:vimrc" (for Amiga) (*)
> > "$VIM/.vimrc" (for Amiga) (*)
> > "$HOME/_vimrc" (for Win32) (*)
> > "$HOME/vimfiles/vimrc" (for Win32) (*)
> > "$VIM/_vimrc" (for Win32) (*)
> > "$HOME/config/settings/vim/vimrc" (for Haiku) (*)
>
> This quote is missing an important word, as shown above.
>
> Perhaps that word should be "or" rather than "and", but either way the
> meaning should be clear:
>
> If VIMINIT is set, it contains ex commands, vim does not search for or
> read any rc file, and MYVIMRC is not set.
>
> If VIMINIT is not set, vim searches for a file in the places listed
> above, and sets MYVIMRC to the file that was found and read.
>
> So, MYVIMRC is not an input to vim, it is how vim communicates to the
> user which file was found and read. If MYVIMRC is exported before
> invoking vim, it is ignored completely; it is neither read nor set.
>
> 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="source /path/to/your/vimrc"
> before (or while) starting vim.
>
> The strongly recommended way is to _not_ use VIMINT, and to place your
> vimrc file at ~/.vim/vimrc. VIMINIT is a compatibility holdover.
>
> ...Marvin

Indeed. This is what I meant to convey, and I apologize if my initial
reply was not clear on this point:

Vim sets MYVIMRC for the user, not the other way around!

--
D. Ben Knoble

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/CALnO6CB5mct8F%3DD%3DSsnUWeEtWyjJNuCtHY-Kk9-od76qoH_V_w%40mail.gmail.com.

Re: $VIMRC over .vimrc ?

On Thu, Mar 19, 2026 at 3:56 AM Christopher <crestchristopher@gmail.com> wrote:
>
>
>
> On Wednesday, March 18, 2026 at 3:48:41 PM UTC-4 Ben Knoble wrote:
>
>
> Le 18 mars 2026 à 14:33, Christopher <crestchr...@gmail.com> a écrit :
>
> 
>
>
>
> On Wednesday, March 18, 2026 at 11:48:15 AM UTC-4 D. Ben Knoble wrote:
>
> On Tuesday, March 17, 2026 at 10:38:51 AM UTC-4 Christopher wrote:
>
> When initializing Vim it searches first for $MYVIMRC, although that file doesn't exist in my case so it immediately goes to .vimrc. I'm reading the documentation on how to create this $VIMRC file as so that it's read first, rather then the .vimrc file ?
>
>
> I'm afraid your question isn't clear to me, but let's look at `:help myvimrc`:
>
> 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. The `$MYVIMDIR` environment variable is
> set to the personal 'rtp' directory, however it is not verified
> that the directory actually exists.
> I The environment variable VIMINIT (see also |compatible-default|) (*)
> The value of $VIMINIT is used as an Ex command line.
> II The user vimrc file(s):
> "$HOME/.vimrc" (for Unix) (*)
> "$HOME/.vim/vimrc" (for Unix) (*)
> "$XDG_CONFIG_HOME/vim/vimrc" (for Unix) (*)
> "s:.vimrc" (for Amiga) (*)
> "home:.vimrc" (for Amiga) (*)
> "home:vimfiles:vimrc" (for Amiga) (*)
> "$VIM/.vimrc" (for Amiga) (*)
> "$HOME/_vimrc" (for Win32) (*)
> "$HOME/vimfiles/vimrc" (for Win32) (*)
> "$VIM/_vimrc" (for Win32) (*)
> "$HOME/config/settings/vim/vimrc" (for Haiku) (*)
>
> Note: For Unix and Amiga, when ".vimrc" does not exist,
> "_vimrc" is also tried, in case an MS-DOS compatible file
> system is used. For MS-Windows ".vimrc" is checked after
> "_vimrc", in case long file names are used.
> Note: For Win32, "$HOME" is checked first. If no "_vimrc" or
> ".vimrc" is found there, "$VIM" is tried. See |$VIM| for when
> $VIM is not set.
> III The environment variable EXINIT.
> The value of $EXINIT is used as an Ex command line.
> IV 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 (*)!
> V The default vimrc file, $VIMRUNTIME/defaults.vim. This sets up
> options values and has "syntax on" and "filetype on" commands,
> which is what most new users will want. See |defaults.vim|.
>
> So, unless you use VIMINIT to set MYVIMRC, MYVIMRC is intended to be set _by Vim_ to the file it finds.
>
> Most folks I know use either ~/.vimrc or ~/.vim/vimrc (with equivalent ~/_vimrc or ~/vimfiles/vimrc on Windows).
>
>
> I read the documentation, therefore like with many I also use the system wide .vimrc file when starting vim. I want to know how to set the $MYVIMRC as the documentation ?
>
>
> Vim should set it automatically; ":let $MYVIMRC" should show the value, for example.
>
> I don't recommend using the system-wide vimrc for anything beyond extremely niche use cases (maybe special hardware or software settings?). The per-user vimrc is more predictable to reason about. In a single-user environment this may matter less, but still.
>
>
> In my case running the command ":let $MYVIMRC" returns a invalid expression.

Indeed. Should be ":echo $MYVIMRC" then. (I usually go with :let for…
reasons… but it apparently doesn't work here.)

--
D. Ben Knoble

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/CALnO6CCnU44Aahyt2fLVbJ59BBm-VBJOiWHL-L8REi%2BoibcW4A%40mail.gmail.com.

Re: $VIMRC over .vimrc ?

* Gary Johnson <garyjohn@spocom.com> [260319 09:04]:
> 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.

Christian's interpretation is how I also interpret this, and it is
empirically corroborated.

Everyone seems to quote the help as saying "unless `$MYVIMRC` was
already set when using VIMINIT."

However, my vim (9.0.0135 which is several years old) has the word
"and", and there are no backticks around $MYVIMRC: "unless $MYVIMRC was
already set and when using VIMINIT."

Perhaps the word "and" was inadvertently dropped when editing this
(perhaps to add the backticks)?

...Marvin

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/abwEpIDJzvUe/ou1%40basil.wdw.

Re: $VIMRC over .vimrc ?

* Christopher <crestchristopher@gmail.com> [260319 03:56]:
> On Wednesday, March 18, 2026 at 3:48:41 PM UTC-4 Ben Knoble wrote:
> I'm afraid your question isn't clear to me, but let's look at `:help
> myvimrc`:
>
> 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

and

> when using VIMINIT. The `$MYVIMDIR` environment variable is
> set to the personal 'rtp' directory, however it is not verified
> that the directory actually exists.
> I The environment variable VIMINIT (see also |compatible-default|) (*)
> The value of $VIMINIT is used as an Ex command line.
> II The user vimrc file(s):
> "$HOME/.vimrc" (for Unix) (*)
> "$HOME/.vim/vimrc" (for Unix) (*)
> "$XDG_CONFIG_HOME/vim/vimrc" (for Unix) (*)
> "s:.vimrc" (for Amiga) (*)
> "home:.vimrc" (for Amiga) (*)
> "home:vimfiles:vimrc" (for Amiga) (*)
> "$VIM/.vimrc" (for Amiga) (*)
> "$HOME/_vimrc" (for Win32) (*)
> "$HOME/vimfiles/vimrc" (for Win32) (*)
> "$VIM/_vimrc" (for Win32) (*)
> "$HOME/config/settings/vim/vimrc" (for Haiku) (*)

This quote is missing an important word, as shown above.

Perhaps that word should be "or" rather than "and", but either way the
meaning should be clear:

If VIMINIT is set, it contains ex commands, vim does not search for or
read any rc file, and MYVIMRC is not set.

If VIMINIT is not set, vim searches for a file in the places listed
above, and sets MYVIMRC to the file that was found and read.

So, MYVIMRC is not an input to vim, it is how vim communicates to the
user which file was found and read. If MYVIMRC is exported before
invoking vim, it is ignored completely; it is neither read nor set.

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="source /path/to/your/vimrc"
before (or while) starting vim.

The strongly recommended way is to _not_ use VIMINT, and to place your
vimrc file at ~/.vim/vimrc. VIMINIT is a compatibility holdover.

...Marvin

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/abv92rfq%2BH/vlJUq%40basil.wdw.

Re: $VIMRC over .vimrc ?

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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/abv3hXDtGRarmEsp%40256bit.org.

Re: $VIMRC over .vimrc ?

On 2026-03-19, Igbanam Ogbuluijah wrote:
> On Wed, Mar 18, 2026 at 10:12:49PM +0000, Gary Johnson wrote:
> > On 2026-03-18, Eric Marceau wrote:
> > > I did a little experiment:
> >
> > [...]
> >
> > I did something similar with terminal vim. I set MYVIMRC directly
> > in my environment and set it in VIMINIT, also in my environment,
> > before starting vim. In all cases, I could see both environment
> > variables within vim and in the environment after shelling out of
> > vim, but in no case was there any evidence of those variables
> > affecting the vimrc sourced by vim at startup. The $MYVIMRC file
> > did not appear in the output of :scriptnames and none of the
> > settings made in that file were set in vim. The only vimrc sourced
> > was the system vimrc, /etc/vim/vimrc on Ubuntu.
> >
> > It does seem like something is broken, because from vim's
> > documentation, I would have expected the file specified by MYVIMRC
> > to have been sourced.

> It's not that something's broken; but there definitely is some
> misconception.
>
> What I think is going on is…
>
> 1. The top two places Vim searches for configuration are
> a. a VIMINIT environment variable
> b. Some VIMRC file
> 2. You can set an environment variable, VIMINIT; it should have Ex
> commands in it.
> 3. If there's no VIMINIT, Vim searches some predefined paths to set
> VIMRC.
>
> I don't think VIMRC is an env variable Vim respects; I think it's an env
> variable it sets based on where it finds a vimrc file.

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.

Regards,
Gary

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/20260319130425.GD10946%40phoenix.

Re: $VIMRC over .vimrc ?



On Thursday, March 19, 2026 at 3:01:12 AM UTC-4 Igbanam Ogbuluijah wrote:
On Wed, Mar 18, 2026 at 10:12:49PM +0000, Gary Johnson wrote:
> On 2026-03-18, Eric Marceau wrote:
> > I did a little experiment:
>
> [...]
>
> I did something similar with terminal vim. I set MYVIMRC directly
> in my environment and set it in VIMINIT, also in my environment,
> before starting vim. In all cases, I could see both environment
> variables within vim and in the environment after shelling out of
> vim, but in no case was there any evidence of those variables
> affecting the vimrc sourced by vim at startup. The $MYVIMRC file
> did not appear in the output of :scriptnames and none of the
> settings made in that file were set in vim. The only vimrc sourced
> was the system vimrc, /etc/vim/vimrc on Ubuntu.
>
> It does seem like something is broken, because from vim's
> documentation, I would have expected the file specified by MYVIMRC
> to have been sourced.
>
> Regards,
> Gary
>
> --
> --
> 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 vim_use+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/vim_use/20260319051249.GC10946%40phoenix.

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

What I think is going on is…

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

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


~ Igbanam

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" 

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

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/e84dc9e9-0831-4de2-a5d2-33aed9dbed5dn%40googlegroups.com.

Re: $VIMRC over .vimrc ?



On Wednesday, March 18, 2026 at 3:48:41 PM UTC-4 Ben Knoble wrote:

Le 18 mars 2026 à 14:33, Christopher <crestchr...@gmail.com> a écrit :




On Wednesday, March 18, 2026 at 11:48:15 AM UTC-4 D. Ben Knoble wrote:
On Tuesday, March 17, 2026 at 10:38:51 AM UTC-4 Christopher wrote:
When initializing Vim it searches first for $MYVIMRC, although that file doesn't exist in my case so it immediately goes to .vimrc. I'm reading the documentation on how to create this $VIMRC file as so that it's read first, rather then the .vimrc file ?

I'm afraid your question isn't clear to me, but let's look at `:help myvimrc`:

     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.  The `$MYVIMDIR` environment variable is
set to the personal 'rtp' directory, however it is not verified
that the directory actually exists.
I   The environment variable VIMINIT (see also |compatible-default|) (*)
    The value of $VIMINIT is used as an Ex command line.
II  The user vimrc file(s):
    "$HOME/.vimrc"   (for Unix) (*)
    "$HOME/.vim/vimrc"   (for Unix) (*)
    "$XDG_CONFIG_HOME/vim/vimrc"  (for Unix) (*)
    "s:.vimrc"   (for Amiga) (*)
    "home:.vimrc"   (for Amiga) (*)
    "home:vimfiles:vimrc"   (for Amiga) (*)
    "$VIM/.vimrc"   (for Amiga) (*)
    "$HOME/_vimrc"   (for Win32) (*)
    "$HOME/vimfiles/vimrc"   (for Win32) (*)
    "$VIM/_vimrc"   (for Win32) (*)
    "$HOME/config/settings/vim/vimrc" (for Haiku) (*)

Note: For Unix and Amiga, when ".vimrc" does not exist,
"_vimrc" is also tried, in case an MS-DOS compatible file
system is used.  For MS-Windows ".vimrc" is checked after
"_vimrc", in case long file names are used.
Note: For Win32, "$HOME" is checked first.  If no "_vimrc" or
".vimrc" is found there, "$VIM" is tried.  See |$VIM| for when
$VIM is not set.
III The environment variable EXINIT.
    The value of $EXINIT is used as an Ex command line.
IV  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 (*)!
V   The default vimrc file, $VIMRUNTIME/defaults.vim.  This sets up
    options values and has "syntax on" and "filetype on" commands,
    which is what most new users will want.  See |defaults.vim|.

So, unless you use VIMINIT to set MYVIMRC, MYVIMRC is intended to be set _by Vim_ to the file it finds.

Most folks I know use either ~/.vimrc or ~/.vim/vimrc (with equivalent ~/_vimrc or ~/vimfiles/vimrc on Windows). 

I read the documentation, therefore like with many I also use the system wide .vimrc file when starting vim. I want to know how to set  the $MYVIMRC as the documentation ? 

Vim should set it automatically; ":let $MYVIMRC" should show the value, for example. 

I don't recommend using the system-wide vimrc for anything beyond extremely niche use cases (maybe special hardware or software settings?). The per-user vimrc is more predictable to reason about. In a single-user environment this may matter less, but still.

In my case running the command ":let $MYVIMRC" returns a invalid expression.  

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/92e993d6-8baf-4b42-bfee-c7eab4962f9bn%40googlegroups.com.

Re: $VIMRC over .vimrc ?

On Wed, Mar 18, 2026 at 10:12:49PM +0000, Gary Johnson wrote:
> On 2026-03-18, Eric Marceau wrote:
> > I did a little experiment:
>
> [...]
>
> I did something similar with terminal vim. I set MYVIMRC directly
> in my environment and set it in VIMINIT, also in my environment,
> before starting vim. In all cases, I could see both environment
> variables within vim and in the environment after shelling out of
> vim, but in no case was there any evidence of those variables
> affecting the vimrc sourced by vim at startup. The $MYVIMRC file
> did not appear in the output of :scriptnames and none of the
> settings made in that file were set in vim. The only vimrc sourced
> was the system vimrc, /etc/vim/vimrc on Ubuntu.
>
> It does seem like something is broken, because from vim's
> documentation, I would have expected the file specified by MYVIMRC
> to have been sourced.
>
> Regards,
> Gary
>
> --
> --
> 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 vim_use+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/vim_use/20260319051249.GC10946%40phoenix.

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

What I think is going on is…

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

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


~ Igbanam

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/abueMbC-XowVrZUv%40Edgar.local.

Wednesday, March 18, 2026

Re: $VIMRC over .vimrc ?

On 2026-03-18, Eric Marceau wrote:
> I did a little experiment:

[...]

I did something similar with terminal vim. I set MYVIMRC directly
in my environment and set it in VIMINIT, also in my environment,
before starting vim. In all cases, I could see both environment
variables within vim and in the environment after shelling out of
vim, but in no case was there any evidence of those variables
affecting the vimrc sourced by vim at startup. The $MYVIMRC file
did not appear in the output of :scriptnames and none of the
settings made in that file were set in vim. The only vimrc sourced
was the system vimrc, /etc/vim/vimrc on Ubuntu.

It does seem like something is broken, because from vim's
documentation, I would have expected the file specified by MYVIMRC
to have been sourced.

Regards,
Gary

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/20260319051249.GC10946%40phoenix.

Re: $VIMRC over .vimrc ?

I did a little experiment:

$ gvim dum

  • At this point, the file 'dum' was opened with my proper default,
    ~/.vim/vimrc

$ MYVIMRC=~/.vimrc.HOLD ; export MYVIMRC
$ gvim dum

  • There are significant theme differences between the two files,
    but those differences were not reflected in the displayed theme.

$ MYVIMRC="" ; export MYVIMRC
$ unset MYVIMRC
$ VIMRC=~/.vimrc.HOLD ; export VIMRC
$ gvim dum

  • Again, those differences were not reflected in the displayed theme.

So ... are those two variables actually being used anymore?



On 2026-03-18 19:32, Igbanam Ogbuluijah wrote:
On Wed, Mar 18, 2026 at 03:48:19PM +0000, Ben Knoble wrote:  
      Le 18 mars 2026 à 14:33, Christopher <crestchristopher@gmail.com> a écrit :              On Wednesday, March 18, 2026 at 11:48:15 AM UTC-4 D. Ben Knoble wrote:            On Tuesday, March 17, 2026 at 10:38:51 AM UTC-4 Christopher wrote:                When initializing Vim it searches first for $MYVIMRC, although that              file doesn't exist in my case so it immediately goes to .vimrc. I'm              reading the documentation on how to create this $VIMRC file as so              that it's read first, rather then the .vimrc file ?              I'm afraid your question isn't clear to me, but let's look at `:help          myvimrc`:                 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.  The `$MYVIMDIR` environment variable is          set to the personal 'rtp' directory, however it is not verified          that the directory actually exists.          I   The environment variable VIMINIT (see also |compatible-default|)          (*)              The value of $VIMINIT is used as an Ex command line.          II  The user vimrc file(s):              "$HOME/.vimrc"   (for Unix) (*)              "$HOME/.vim/vimrc"   (for Unix) (*)              "$XDG_CONFIG_HOME/vim/vimrc"  (for Unix) (*)              "s:.vimrc"   (for Amiga) (*)              "home:.vimrc"   (for Amiga) (*)              "home:vimfiles:vimrc"   (for Amiga) (*)              "$VIM/.vimrc"   (for Amiga) (*)              "$HOME/_vimrc"   (for Win32) (*)              "$HOME/vimfiles/vimrc"   (for Win32) (*)              "$VIM/_vimrc"   (for Win32) (*)              "$HOME/config/settings/vim/vimrc" (for Haiku) (*)            Note: For Unix and Amiga, when ".vimrc" does not exist,          "_vimrc" is also tried, in case an MS-DOS compatible file          system is used.  For MS-Windows ".vimrc" is checked after          "_vimrc", in case long file names are used.          Note: For Win32, "$HOME" is checked first.  If no "_vimrc" or          ".vimrc" is found there, "$VIM" is tried.  See |$VIM| for when          $VIM is not set.          III The environment variable EXINIT.              The value of $EXINIT is used as an Ex command line.          IV  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 (*)!          V   The default vimrc file, $VIMRUNTIME/defaults.vim.  This sets up              options values and has "syntax on" and "filetype on" commands,              which is what most new users will want.  See |defaults.vim|.            So, unless you use VIMINIT to set MYVIMRC, MYVIMRC is intended to be          set _by Vim_ to the file it finds.            Most folks I know use either ~/.vimrc or ~/.vim/vimrc (with equivalent          ~/_vimrc or ~/vimfiles/vimrc on Windows).           I read the documentation, therefore like with many I also use the system      wide .vimrc file when starting vim. I want to know how to set  the $MYVIMRC      as the documentation ?       Vim should set it automatically; ":let $MYVIMRC" should show the value, for  example.     I don't recommend using the system-wide vimrc for anything beyond extremely  niche use cases (maybe special hardware or software settings?). The per-user  vimrc is more predictable to reason about. In a single-user environment this  may matter less, but still.    --  --  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 vim_use+unsubscribe@googlegroups.com.  To view this discussion visit https://groups.google.com/d/msgid/vim_use/  70549B20-8E72-4C91-B37A-C4564E9A67DF%40gmail.com.  
  Hold on… the OP may have a point here.    The documentation does say something about environment variables; but I  think we are jumping into some user-global VIMRC because, quite frankly,  that's the cultural way of going this. But…!    The documentation does say there's an environment variable `VIMINIT`  which can be set as an Ex command, and this would be the first place Vim  looks to for initialization configuration. Now, the way I got this to  work is        VIMINIT="set number relativenumber" vim    I did this on a blank install of vim. Without the VIMINIT variable set,  there are no numbers.    So if you're looking to set an environment variable Vim respects on  initialization, this is it. That said, the amount of customizations  going into Vim these days is way too much for an environment variable;  plus… if you want to use the environment variable to source some file,  you might as well use a VIMRC, and use the `runtime` command for multipe  files. I think this is the reason the community has culturally favoured  the VIMRC route for customizations.    Just thought to call this out since the OP was specific about an  environment variable.      ~ Igbanam    

Re: $VIMRC over .vimrc ?

On Wed, Mar 18, 2026 at 03:48:19PM +0000, Ben Knoble wrote:
>
> Le 18 mars 2026 à 14:33, Christopher <crestchristopher@gmail.com> a écrit :
>
>
>
>
> On Wednesday, March 18, 2026 at 11:48:15 AM UTC-4 D. Ben Knoble wrote:
>
> On Tuesday, March 17, 2026 at 10:38:51 AM UTC-4 Christopher wrote:
>
> When initializing Vim it searches first for $MYVIMRC, although that
> file doesn't exist in my case so it immediately goes to .vimrc. I'm
> reading the documentation on how to create this $VIMRC file as so
> that it's read first, rather then the .vimrc file ?
>
>
> I'm afraid your question isn't clear to me, but let's look at `:help
> myvimrc`:
>
> 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. The `$MYVIMDIR` environment variable is
> set to the personal 'rtp' directory, however it is not verified
> that the directory actually exists.
> I The environment variable VIMINIT (see also |compatible-default|)
> (*)
> The value of $VIMINIT is used as an Ex command line.
> II The user vimrc file(s):
> "$HOME/.vimrc" (for Unix) (*)
> "$HOME/.vim/vimrc" (for Unix) (*)
> "$XDG_CONFIG_HOME/vim/vimrc" (for Unix) (*)
> "s:.vimrc" (for Amiga) (*)
> "home:.vimrc" (for Amiga) (*)
> "home:vimfiles:vimrc" (for Amiga) (*)
> "$VIM/.vimrc" (for Amiga) (*)
> "$HOME/_vimrc" (for Win32) (*)
> "$HOME/vimfiles/vimrc" (for Win32) (*)
> "$VIM/_vimrc" (for Win32) (*)
> "$HOME/config/settings/vim/vimrc" (for Haiku) (*)
>
> Note: For Unix and Amiga, when ".vimrc" does not exist,
> "_vimrc" is also tried, in case an MS-DOS compatible file
> system is used. For MS-Windows ".vimrc" is checked after
> "_vimrc", in case long file names are used.
> Note: For Win32, "$HOME" is checked first. If no "_vimrc" or
> ".vimrc" is found there, "$VIM" is tried. See |$VIM| for when
> $VIM is not set.
> III The environment variable EXINIT.
> The value of $EXINIT is used as an Ex command line.
> IV 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 (*)!
> V The default vimrc file, $VIMRUNTIME/defaults.vim. This sets up
> options values and has "syntax on" and "filetype on" commands,
> which is what most new users will want. See |defaults.vim|.
>
> So, unless you use VIMINIT to set MYVIMRC, MYVIMRC is intended to be
> set _by Vim_ to the file it finds.
>
> Most folks I know use either ~/.vimrc or ~/.vim/vimrc (with equivalent
> ~/_vimrc or ~/vimfiles/vimrc on Windows).
>
>
> I read the documentation, therefore like with many I also use the system
> wide .vimrc file when starting vim. I want to know how to set the $MYVIMRC
> as the documentation ?
>
>
> Vim should set it automatically; ":let $MYVIMRC" should show the value, for
> example.
>
> I don't recommend using the system-wide vimrc for anything beyond extremely
> niche use cases (maybe special hardware or software settings?). The per-user
> vimrc is more predictable to reason about. In a single-user environment this
> may matter less, but still.
>
> --
> --
> 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 vim_use+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/vim_use/
> 70549B20-8E72-4C91-B37A-C4564E9A67DF%40gmail.com.

Hold on… the OP may have a point here.

The documentation does say something about environment variables; but I
think we are jumping into some user-global VIMRC because, quite frankly,
that's the cultural way of going this. But…!

The documentation does say there's an environment variable `VIMINIT`
which can be set as an Ex command, and this would be the first place Vim
looks to for initialization configuration. Now, the way I got this to
work is

VIMINIT="set number relativenumber" vim

I did this on a blank install of vim. Without the VIMINIT variable set,
there are no numbers.

So if you're looking to set an environment variable Vim respects on
initialization, this is it. That said, the amount of customizations
going into Vim these days is way too much for an environment variable;
plus… if you want to use the environment variable to source some file,
you might as well use a VIMRC, and use the `runtime` command for multipe
files. I think this is the reason the community has culturally favoured
the VIMRC route for customizations.

Just thought to call this out since the OP was specific about an
environment variable.


~ Igbanam

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/abszdq8iIM9h8cwZ%40Edgar.local.

Re: Current Position

On So, 15 Mär 2026, Christopher wrote:

> I understand it works for you; although as I posted. It doesn't work in my case. I see the `g` in the bottom of the screen but when doing CTRL+G nothing happens ? 

So what system have you tried this? On what terminal emulator? Have you
tried the GUI as well? Since :exe "norm g\<c-g>" works, it can only be
that Vim or the terminal is not recognizing the literal ctrl-g key.

Thanks,
Christian
--
Your conscience never stops you from doing anything. It just stops you
from enjoying it.

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/absc7NfngT0ScIKN%40256bit.org.

Re: $VIMRC over .vimrc ?


Le 18 mars 2026 à 14:33, Christopher <crestchristopher@gmail.com> a écrit :



On Wednesday, March 18, 2026 at 11:48:15 AM UTC-4 D. Ben Knoble wrote:
On Tuesday, March 17, 2026 at 10:38:51 AM UTC-4 Christopher wrote:
When initializing Vim it searches first for $MYVIMRC, although that file doesn't exist in my case so it immediately goes to .vimrc. I'm reading the documentation on how to create this $VIMRC file as so that it's read first, rather then the .vimrc file ?

I'm afraid your question isn't clear to me, but let's look at `:help myvimrc`:

     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.  The `$MYVIMDIR` environment variable is
set to the personal 'rtp' directory, however it is not verified
that the directory actually exists.
I   The environment variable VIMINIT (see also |compatible-default|) (*)
    The value of $VIMINIT is used as an Ex command line.
II  The user vimrc file(s):
    "$HOME/.vimrc"   (for Unix) (*)
    "$HOME/.vim/vimrc"   (for Unix) (*)
    "$XDG_CONFIG_HOME/vim/vimrc"  (for Unix) (*)
    "s:.vimrc"   (for Amiga) (*)
    "home:.vimrc"   (for Amiga) (*)
    "home:vimfiles:vimrc"   (for Amiga) (*)
    "$VIM/.vimrc"   (for Amiga) (*)
    "$HOME/_vimrc"   (for Win32) (*)
    "$HOME/vimfiles/vimrc"   (for Win32) (*)
    "$VIM/_vimrc"   (for Win32) (*)
    "$HOME/config/settings/vim/vimrc" (for Haiku) (*)

Note: For Unix and Amiga, when ".vimrc" does not exist,
"_vimrc" is also tried, in case an MS-DOS compatible file
system is used.  For MS-Windows ".vimrc" is checked after
"_vimrc", in case long file names are used.
Note: For Win32, "$HOME" is checked first.  If no "_vimrc" or
".vimrc" is found there, "$VIM" is tried.  See |$VIM| for when
$VIM is not set.
III The environment variable EXINIT.
    The value of $EXINIT is used as an Ex command line.
IV  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 (*)!
V   The default vimrc file, $VIMRUNTIME/defaults.vim.  This sets up
    options values and has "syntax on" and "filetype on" commands,
    which is what most new users will want.  See |defaults.vim|.

So, unless you use VIMINIT to set MYVIMRC, MYVIMRC is intended to be set _by Vim_ to the file it finds.

Most folks I know use either ~/.vimrc or ~/.vim/vimrc (with equivalent ~/_vimrc or ~/vimfiles/vimrc on Windows). 

I read the documentation, therefore like with many I also use the system wide .vimrc file when starting vim. I want to know how to set  the $MYVIMRC as the documentation ? 

Vim should set it automatically; ":let $MYVIMRC" should show the value, for example. 

I don't recommend using the system-wide vimrc for anything beyond extremely niche use cases (maybe special hardware or software settings?). The per-user vimrc is more predictable to reason about. In a single-user environment this may matter less, but still.

Re: $VIMRC over .vimrc ?

* Christopher <crestchristopher@gmail.com> [260318 14:33]:
> I read the documentation, therefore like with many I also use the system
> wide .vimrc file when starting vim. I want to know how to set the $MYVIMRC
> as the documentation ?

It is set automatically by vim within the vim session. Assuming you are
using Linux (or other Unix-like OS), try

echo $MYVIMRC

from the command line. It should print a blank line if it is not set.
Now, invoke vim and try :echo $MYVIMRC from within vim. It will be set
to the full path of the vimrc file that was used.

Vim will export this for subshells. Still within vim, try

:! echo $MYVIMRC

(note the space after the "!"). This will create a subshell and
demonstrate that MYVIMRC is exported. After you leave vim, the variable
should not be set in your shell; this is normal.

You should not set this variable yourself; let vim do it.

...Marvin

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/absBErLDWQq6G1Vj%40basil.wdw.

Re: Current Position - Attempt to hide email address ??? Linux-Ottawa (OCLUG) Wiki



On Wednesday, March 18, 2026 at 2:39:38 PM UTC-4 Eric Marceau wrote:

Getting back to the concern of exposing Contributor/Member email addresses, I offer the example of the Ottawa Linux User Group, which hides those addresses.


Also, the Discourse site forwards all discussion postings to your personal email, if you subscribe to that, but your email is not public on the forums.


Eric Marceau


On 2026-03-16 14:30, Eric Marceau wrote:

I think the concern about exposing your email address is moot.

(snapshot from my Thunderbird client)

Wouldn't you say?

Eric

On 2026-03-15 09:17, Christopher wrote:

 I understand it works for you; although as I posted. It doesn't work in my case. I see the `g` in the bottom of the screen but when doing CTRL+G nothing happens ? 

The method of using the `...` to post below using Google Groups web interface exposes my email address; do I want that ? 


On Saturday, March 14, 2026 at 9:40:29 PM UTC-4 Yongwei Wu wrote:
On Sat, 14 Mar 2026 at 16:56, Christopher <crestchr...@gmail.com> wrote:
I tried another version on another installation; the same thing. This is frustrating why it's not working; I assume if I can't get this to work similar commands will not work. Therefore I really want to solve this issue.

1. What did you see when you type g followed by Ctrl-G?
2. What's the output of `:nmap` after starting Vim with `vim --clean`?
3. If still unsolved, what's your output of `:version`?

--
Yongwei Wu
URL: http://wyw.dcweb.cn/
--
--
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 vim_use+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/fd2b8101-c1d0-4f60-b14a-ff306fa4a13cn%40googlegroups.com.

Although in this group; it's exposed.  

--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/461d11de-3de6-474d-9de5-b9d467de1a62n%40googlegroups.com.