try
vim -u /home/user/.vimrc .
and compare with
vim .
The former won't open the netrw tree on my system, the later will.
The /usr/bin/vim option will also open a netrw tree when issued with -u flag on the current (dot .) directory.
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)
Ubuntu 20.04, wezterm 20240203-110809-5046fc22, xterm-256color, GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
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.
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.
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.
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.
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.
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.
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.
@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.
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.
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.
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.