Bug#864074: defaults.vim: broken configuration

Martin Steigerwald martin at lichtvoll.de
Sat Jul 8 21:36:07 UTC 2017


Dear James.

Thank you for your detailed answer.

James McCoy - 05.07.17, 21:09:
> On Wed, Jul 05, 2017 at 09:55:06PM +0200, Martin Steigerwald wrote:
> > Dear Maintainer.
> > 
> > I know of this:
> > > Vim will load $VIMRUNTIME/defaults.vim if the user does not have a
> > > vimrc.
> > > This happens after /etc/vim/vimrc(.local) are loaded, so it will
> > > override
> > > any settings in these files.
> > 
> > But the settings in "defaults.vim" IMHO are just *completely* broken for
> > several reasons:
> > 
> > 1) Maybe due to a bug in Vim regarding mouse handling with "set mouse=a"
> > Vim is just madly moving around the cursor and doing whatelse not for
> > easily a minute in a lot of freshly installed Debian 9 VMs accesses via
> > SSH and screen from Plasma´s Konsole terminal emulator.
> 
> These problems are more typically due to people/software setting
> incorrect values for $TERM and/or related options in Vim ('ttymouse',
> 'term', etc.).  Vim can only act on the information it has, so when
> that's incorrect -- garbage in, garbage out.

$TERM is "xterm-256color" in console.

> That being said, "set mouse=a" _is_ one setting I argued against
> upstream.  I would encourage you to post your experiences and reasoning
> against that setting to vim at vim.org.  I'd rather see this changed
> upstream instead of piecewise changing parts of defaults.vim.

I am not sure I want to do this.

> > 3) Vim wordwraps by default now. I wonder about how many admins will break
> > config files with long lines accidently by that new default behaviour.
> 
> I don't see anything in defaults.vim that changes 'textwidth' from its
> default value of 0, so I'm not sure what you're experiencing here.
> Maybe ":verbose set textwidth?" will help next time you run into this
> issue.

I have seen it word-wrap, well now I disabled defaults.vim on all my systems. 
I comment out the disabling on one system. I may do so next week. On my laptop 
I also have ~/.vimrc files.

> > I think it is broken behaviour, that "defaults.vim" is loaded *after*
> > "vimrc.local". The sane default would be this order:
> > 
> > 1. Global vim configuration
> > 2. /etc/vim/vimrc.local
> > 3. $HOME/.vimrc
> 
> This _is_ the behavior.  The _only_ way that defaults.vim is used is
> when $HOME/.vimrc doesn't exist.
> 
> Note that /etc/vim/vimrc.local is a Debian-specific extension of the
> system-wide vimrc, to avoid conffile prompts during upgrades, so 1 & 2
> are the same thing.

My order wasn´t complete. I think it should be:

1. Global vim configuration
2. /etc/vim/vimrc.local
3. $HOME/.vimrc
4. defaults.vim

so that defaults.vim can only ever set any setting that has *not* been set by 
any of the other configuration files.

It is completely unintuitive that defaults.vim overwrites settings in 
vimrc.local by default. If I write "set mouse=" in there, I mean it. I really 
dislike software that pretends it knows better than me unless I tell that 
software to stop that behavior.

Never *ever* overwrite user/admin made settings.

> defaults.vim is intentionally loaded _after_ $HOME/.vimrc so that Vim
> can choose not to load it when $HOME/.vimrc exists.  The situation
> you're running into is that you don't have $HOME/.vimrc and therefore
> are having the system-wide values adjusted by defaults.vim.

Alternatively vim should not load defaults.vim if vimrc.local exists I think.

Thanks,
-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20170708/ac414fdb/attachment.sig>


More information about the pkg-vim-maintainers mailing list