[lfs-dev] Configuring vim and position of defaults.vim

Bruce Dubbs bruce.dubbs at gmail.com
Mon Mar 12 16:51:12 PDT 2018


On 03/12/2018 06:27 PM, dueffert at uwe-dueffert.de wrote:
> Hi,
> 
> On Mon, 12 Mar 2018, Ken Moffat wrote:
> 
>> I don't claim to understand the details, but when I searched a few
>> hours ago there were various posts about changed behaviour (not
>> particularly recent).
> I do not claim to understand the details either, but at least I can 
> confirm such behavior change. And maybe I can provide a test case. I was 
> happy with my vim configuration on several machines (Debian, Ubuntu, 
> LFS) for years, but some update a couple of months ago started to drive 
> me nuts every now and then - mouse support was broken for me: Marking 
> stuff on a console in putty (Windows ssh client) used to end up in the 
> clipboard automatically, and it still does - unless using vim. I even 
> switched to using nano temporarily just to make that work again.
> 
> Reason was a "mouse=a" in some default pulled in "recently". 
> Documentation suggests this is something everybody would want to make a 
> mouse work, but I certainly do not, because it makes vim "capture" the 
> mouse internally which breaks my usage of it.
> 
> Anyway, the problem is not that "mouse=a" was there, but how to disable 
> it again. There is "mouse=" in the book which did not seem to help. 
> "mouse-=a" suggested somewhere did not either. I ended up commenting out 
> every occurence of that setting in any vim file on the respective system 
> to get rid of that. This is not an *LFS issue but a vim configuration 
> issue on multiple distributions.
> 
> I'd prefer to understand the correct (current) order of (overriding) vim 
> configuration, though...

We tried to fix this, but perhaps didn't do it well enough.  We added:

source $VIMRUNTIME/defaults.vim
let skip_defaults_vim=1

I suspect removing or commenting out the source command will do what 
most of us want.

The first part of defaults.vim has:

if exists('skip_defaults_vim')
   finish
endif

What we had was trying to prevent defaults.vim running twice. I think it 
was automatically run if ~/.vimrc did not exist.

The offending command in defaults.vim with regard to the mouse is

mouse=a

Setting mouse=r later in the initialization fixes things, but if set in 
/etc/vimrc and defaults.vim runs after that because ~/.vimrc dies not 
exist, then the mouse setting is changed back.

   -- Bruce


More information about the lfs-dev mailing list