Wednesday, March 18, 2026

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.

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

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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/fd2b8101-c1d0-4f60-b14a-ff306fa4a13cn%40googlegroups.com.

Re: $VIMRC over .vimrc ?



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 ? 

--
--
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/8a73adf8-6fd5-4619-88ba-96820a7e71f4n%40googlegroups.com.

Re: $VIMRC over .vimrc ?



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). 

--
--
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/b94a1e26-3185-4298-b3cf-46ecf054c720n%40googlegroups.com.

Tuesday, March 17, 2026

$VIMRC over .vimrc ?

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 ?

--
--
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/591b5f4b-e7e3-4601-93f8-8ac9a7e1ffb7n%40googlegroups.com.