You are not logged in.

#1 2016-08-05 19:15:22

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Vim ignores /etc/vimrc directive but reads from ~/.vimrc

It seems that the recent vim update (7.4.2143-1) changes the behavior of clicking when editing a file to visual mode.  I'd like to globally disable this but setting the following in /etc/vimrc does not get applied:

set mouse-=a

Setting it in ~/.vimrc does work... wtf?

Last edited by graysky (2016-08-05 19:20:06)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2016-08-05 20:05:19

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Vim ignores /etc/vimrc directive but reads from ~/.vimrc

As a sanity check, can you confirm /etc/vimrc is being sourced:

$ vim -V
chdir(/etc)
fchdir() to previous dir
sourcing "/etc/vimrc"
Searching for "archlinux.vim" in ...
...

But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2016-08-05 22:06:20

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Vim ignores /etc/vimrc directive but reads from ~/.vimrc

@alpha - sure does (plus all my other custom stuff in there works):

chdir(/etc)
fchdir() to previous dir
sourcing "/etc/vimrc"
...

Can you confirm both my observation that vis mode is on by default now and that the command to disable it in /etc/vimrc is ignored?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2016-08-05 22:27:53

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Vim ignores /etc/vimrc directive but reads from ~/.vimrc

I can confirm both when I run vim as a user with no vim config, but with my normal user it gets automagically turned off somehow. hmm

Edit: aha (maybe). I discovered that if you run 'vim -V' and then use ':set <var>' it will tell you what last set the variable. With my dummy user and 'set mouse-=a' in /etc/vimrc, ':set mouse' reports

  mouse=a
        Last set from /usr/share/vim/vim74/defaults.vim

So I guess it boils down to sourcing order and /usr/.../defaults.vim is sourced somewhere between /etc/vimrc and ~/.vimrc ?

As for my normal user, /usr/.../defaults.vim apparently doesn't get sourced at all... hmm

Last edited by alphaniner (2016-08-05 22:39:51)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

Board footer

Powered by FluxBB