Bug#856273: vim: explain how the various vimrc files are processed

Paul Slootman paul at debian.org
Mon Feb 27 13:24:13 UTC 2017


Thanks for your quick response.

On Mon 27 Feb 2017, James McCoy wrote:

> On Mon, Feb 27, 2017 at 12:19:40PM +0100, Paul Slootman wrote:
> > On a new installation of stretch, I was being frustrated by vim
> > hijacking the mouse from xterm (so pasting text ended up quite
> > differently than I was expecting).  I figured out I needed to disable
> > the mouse support in vim, so I created /etc/vim/vimrc.local and put
> > set mouse=
> > in there.

> Did the information in NEWS.Debian.gz (which should have been presented
> by apt-listchanges) not help?

Actually, no, because I only encountered the problem on the
newly-installed system, i.e. no old version was installed so no changes
to be listed.

On my regular pc I've gone back and had a look at all the listchanges
mail I received when I upgraded everything a couple of weeks ago, and
this notice was number 38 out of a total of 52 changes listed; so I
think it's excusable that I didn't read everything :-)  If I had
encountered strange behaviour on my regular pc I might have looked over
these changes and found this information, however, as I said, everything
was just fine there because I've had a vimrc since about 1996...

> > However, the mouse was STILL being hijacked, and ":set mouse" showed
> > that the setting in /etc/vim/vimrc.local was apparently being ignored.
> > Via strace I discovered
> 
> A simpler approach would be to look at the output of ":scriptnames".

Strace is my go-to tool for finding out what a process does...
You of course have to know about :scriptnames, which now I do, thanks.
I stopped actively following vim development around 1999 when I stopped
maintaining the OS/2 port :)

> > that defaults.vim was being read AFTER
> > /etc/vim/vimrc.local was processed, and that overruled the vimrc.local.
> > I don't find this logical, I'd expect that anything I put in
> > /etc/vim/vimrc.local would be the "default" setting when starting up vim
> > and any other fine-tuning can be done via the users' ~/.vimrc .
> 
> Upstream specifically chose to have defaults.vim be loaded _only_ when
> the user doesn't have a vimrc file and to leave it up to the sysadminn
> to deal with the interaction between defaults.vim and the system vimrc
> file.  That's why I provided hints in NEWS.Debian about how to deal with
> it at the system level.

Ok; however IMHO /etc/vim/vimrc.local should come after any "standard"
or "default" settings, so I do disagree with first processing
vimrc.local and then defaults.vim. So a note in README.Debian would
still be very helpful for those who encounter this on newly installed
systems, especially as it sounds this is quite Debian-specific.


thanks,
Paul



More information about the pkg-vim-maintainers mailing list