[vim/vim] providing vim -u ~/config/vim/vimrc . won't open netrw tree (Issue #15298)

19 views
Skip to first unread message

Samuel Beer

unread,
Jul 18, 2024, 12:01:32 PM (4 days ago) Jul 18
to vim/vim, Subscribed

Steps to reproduce

try

vim -u /home/user/.vimrc .

and compare with

vim .

The former won't open the netrw tree on my system, the later will.

Expected behaviour

The /usr/bin/vim option will also open a netrw tree when issued with -u flag on the current (dot .) directory.

Version of Vim

8.2 (Included patches: 1-579, 1969, 580-1848, 4975, 5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121)

Environment

Ubuntu 20.04, wezterm 20240203-110809-5046fc22, xterm-256color, GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298@github.com>

Christian Brabandt

unread,
Jul 18, 2024, 2:34:34 PM (4 days ago) Jul 18
to vim/vim, Subscribed

That is most likely because vim -u configfile starts Vim in compatible mode. Please add the -N argument and then it should work.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2237244130@github.com>

Aliaksei Budavei

unread,
Jul 18, 2024, 2:46:07 PM (4 days ago) Jul 18
to vim/vim, Subscribed

I have tested passing the -u flag with the two closest Vim
versions I have (Debian), either lists directory entries:

vim -C -u /path/to/vim-8-2-3900/share/vim/vim82/vimrc_example.vim .
vim -C -u /path/to/vim-9-0-0000/share/vim/vim90/vimrc_example.vim .

Is there any error message with the failing command?

You can list all sourced files with :scriptnames and then
look for g:loaded_netrw etc. in the sourced vimrc files
that may interfere the plugin.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2237277838@github.com>

Christian Brabandt

unread,
Jul 18, 2024, 3:27:13 PM (4 days ago) Jul 18
to vim/vim, Subscribed

I believe vimrc_example.vim explicitly sources defaults.vim which in turn sets nocompatible.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2237371306@github.com>

Aliaksei Budavei

unread,
Jul 18, 2024, 3:37:05 PM (4 days ago) Jul 18
to vim/vim, Subscribed

You're right, and -C will be overridden.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2237385289@github.com>

Aliaksei Budavei

unread,
Jul 18, 2024, 3:46:46 PM (4 days ago) Jul 18
to vim/vim, Subscribed

And E117: Unknown function: netrw#LocalBrowseCheck can be
triggered as follows:

vim +set\ cp -u /path/to/vim-8-2-3900/share/vim/vim82/vimrc_example.vim .
vim +set\ cp -u /path/to/vim-9-0-0000/share/vim/vim90/vimrc_example.vim .


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2237418564@github.com>

Christian Brabandt

unread,
Jul 18, 2024, 4:12:03 PM (4 days ago) Jul 18
to vim/vim, Subscribed

Yes, because of this:
https://github.com/vim/vim/blob/37853b7de31ef34153fe76aa2b740d517ed0e5d4/runtime/autoload/netrw.vim#L39-L42


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2237478722@github.com>

Christian Brabandt

unread,
Jul 19, 2024, 9:48:57 AM (3 days ago) Jul 19
to vim/vim, Subscribed

Closed #15298 as not planned.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/15298/issue_event/13574921376@github.com>

Samuel Beer

unread,
Jul 21, 2024, 2:11:44 AM (yesterday) Jul 21
to vim/vim, Subscribed

@chrisbra That's exactly right it works with the -N flag. Also fixes a problem that I had with setting the leader key. Which makes me think -N should be the default and you should be able to opt in to compatible mode. Was there a reason this is inverted?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2241491681@github.com>

K.Takata

unread,
Jul 21, 2024, 2:30:19 AM (yesterday) Jul 21
to vim/vim, Subscribed

See :help -u.
https://github.com/vim/vim/blob/d887fb81b6d419d035629f06b918b054d30c5fab/runtime/doc/starting.txt#L505-L508


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2241495591@github.com>

Samuel Beer

unread,
Jul 21, 2024, 2:39:32 AM (yesterday) Jul 21
to vim/vim, Subscribed

Yeah I mean it's clear from the manpage, but it was just very surprising to me.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2241497521@github.com>

Christian Brabandt

unread,
Jul 21, 2024, 3:33:02 AM (yesterday) Jul 21
to vim/vim, Subscribed

I am not going to change the default, this would not backwards compatible and it has been like that for as long as I can remember. Back in the Vim 7 days, we always recommended to reproduce issues with vim -u NONE -N.

And the solution is simple. If you want to use a vimrc file from a commandline using -u then you can always :set nocp inside your vimrc file.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15298/2241510364@github.com>

Reply all
Reply to author
Forward
0 new messages