Debian Bug report logs - #864074
vim: 'set mouse=' in /etc/vim/vimrc.local is ignored unless ~/.vimrc exists

version graph

Package: vim; Maintainer for vim is Debian Vim Maintainers <team+vim@tracker.debian.org>; Source for vim is src:vim (PTS, buildd, popcon).

Reported by: Andreas Beckmann <anbe@debian.org>

Date: Sun, 4 Jun 2017 00:12:01 UTC

Severity: important

Found in version vim/2:8.0.0197-4

Done: James McCoy <jamessan@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Sun, 04 Jun 2017 00:12:04 GMT) (full text, mbox, link).


Acknowledgement sent to Andreas Beckmann <anbe@debian.org>:
New Bug report received and forwarded. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Sun, 04 Jun 2017 00:12:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Andreas Beckmann <anbe@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: vim: 'set mouse=' in /etc/vim/vimrc.local is ignored unless ~/.vimrc exists
Date: Sun, 04 Jun 2017 02:10:08 +0200
Package: vim
Version: 2:8.0.0197-4
Severity: important

Hi,

for me the default of 'set mouse=a' is a misfeature, so I want to
disable it globally (my mouse usage ends after marking +
middle-click pasting of text in the terminal, that works fine
without pressing shift).

Unfortunately 'set mouse=' does not work in /etc/vim/vimrc.local, it is
just ignored. Other options work there.
But it works if (even an empty) ~/.vimrc does exist.

This is with vim.basic, running as root, in a fresh stretch install,
three ssh hops, a screen and a su away (where I wouldn't expect a
mouse to be usable) in case it does matter.

While trying to debug this, I also noticed discrepancies in what is set
by default, depending on whether an (empty) ~/.vimrc exists:

* without ~/.vimrc:

:set                                                                                                                                                                                      
--- Options ---
  display=truncate    incsearch         nolangremap           mouse=a             ruler               showcmd             ttimeoutlen=100     ttymouse=xterm
  history=200         langnoremap       nomodeline            nrformats=bin,hex   scrolloff=5         ttimeout            ttyfast             wildmenu
  backspace=indent,eol,start
  fileencodings=ucs-bom,utf-8,default,latin1
  printoptions=paper:a4
  runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after
  suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc

* after touching ~/.vimrc:

:set                                                                                                                                                                                                
--- Options ---
nomodeline            ruler               ttyfast             ttymouse=xterm
  backspace=indent,eol,start
  fileencodings=ucs-bom,utf-8,default,latin1
  printoptions=paper:a4
  runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after
  suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc

The set of defaults should not depend on merely the fact that ~/.vimrc exists.

I consider this a regression from jessie, since vimrc.local worked
there without ~/.vimrc for all options I needed (but that didn't
include 'set mouse=').

For reference: these are the options set in jessie by vim.basic
independent from the existence of ~/.vimrc:

:set                                                                                                                                                                                                
--- Options ---
nomodeline            ruler               ttyfast             ttymouse=xterm
  backspace=indent,eol,start
  runtimepath=/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/.vim/after
  suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc


Andreas



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Sun, 04 Jun 2017 02:51:02 GMT) (full text, mbox, link).


Acknowledgement sent to James McCoy <jamessan@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Sun, 04 Jun 2017 02:51:03 GMT) (full text, mbox, link).


Message #10 received at 864074@bugs.debian.org (full text, mbox, reply):

From: James McCoy <jamessan@debian.org>
To: Andreas Beckmann <anbe@debian.org>, 864074@bugs.debian.org
Subject: Re: Bug#864074: vim: 'set mouse=' in /etc/vim/vimrc.local is ignored unless ~/.vimrc exists
Date: Sat, 3 Jun 2017 22:48:23 -0400
On Sun, Jun 04, 2017 at 02:10:08AM +0200, Andreas Beckmann wrote:
> for me the default of 'set mouse=a' is a misfeature, so I want to
> disable it globally (my mouse usage ends after marking +
> middle-click pasting of text in the terminal, that works fine
> without pressing shift).
> 
> Unfortunately 'set mouse=' does not work in /etc/vim/vimrc.local, it is
> just ignored. Other options work there.
> But it works if (even an empty) ~/.vimrc does exist.

Please see NEWS.Debian.gz and /etc/vim/vimrc which have similarly worded
descriptions 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.
  " If you don't want that to happen, uncomment the below line to prevent
  " defaults.vim from being loaded.
  " let g:skip_defaults_vim = 1

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Wed, 05 Jul 2017 19:57:04 GMT) (full text, mbox, link).


Acknowledgement sent to Martin Steigerwald <martin@lichtvoll.de>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Wed, 05 Jul 2017 19:57:05 GMT) (full text, mbox, link).


Message #15 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Martin Steigerwald <martin@lichtvoll.de>
To: 864074@bugs.debian.org
Subject: defaults.vim: broken configuration
Date: Wed, 05 Jul 2017 21:55:06 +0200
[Message part 1 (text/plain, inline)]
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.

2) Activated mouse handling breaks copy and paste text from Plasma´s clipboard 
by… auto-indenting and what else not. I know of "set nopaste" (or what else it 
was called)… but having to activate it is an additional nuisance.

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.

These defaults may be somewhat suitable for a desktop editor, but for Vim I 
think they are just plain broken. So I kindly ask you reconsider applying this 
broken configuration… or at least consider restoring a sane order in which Vim 
applies configuration:

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

The current order is a cross disrespect and paternalism for the local site 
admin.

The order vim uses now makes it necessary for me to add

let g:skip_defaults_vim = 1

to *any* newly installed Debian 9 system.

In addition to "screen" this is the second new default config that breaks 
existing setups.

Thank you,
-- 
Martin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Thu, 06 Jul 2017 01:12:02 GMT) (full text, mbox, link).


Acknowledgement sent to James McCoy <jamessan@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Thu, 06 Jul 2017 01:12:02 GMT) (full text, mbox, link).


Message #20 received at 864074@bugs.debian.org (full text, mbox, reply):

From: James McCoy <jamessan@debian.org>
To: Martin Steigerwald <martin@lichtvoll.de>, 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Wed, 5 Jul 2017 21:09:23 -0400
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.

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@vim.org.  I'd rather see this changed
upstream instead of piecewise changing parts of defaults.vim.

> 2) Activated mouse handling breaks copy and paste text from Plasma´s clipboard 
> by… auto-indenting and what else not. I know of "set nopaste" (or what else it 
> was called)… but having to activate it is an additional nuisance.

This should actually behave better once I'm able to upload a newer
version of Vim, since it knows how to use bracketed paste mode.

> 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 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.

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.

That behavior is the entire reason why I added documentation to
/etc/vim/vimrc (which one has to read to know about vimrc.local) about
how to deal with defaults.vim.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Sat, 08 Jul 2017 21:39:03 GMT) (full text, mbox, link).


Acknowledgement sent to Martin Steigerwald <martin@lichtvoll.de>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Sat, 08 Jul 2017 21:39:03 GMT) (full text, mbox, link).


Message #25 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Martin Steigerwald <martin@lichtvoll.de>
To: James McCoy <jamessan@debian.org>
Cc: 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Sat, 08 Jul 2017 23:36:07 +0200
[Message part 1 (text/plain, inline)]
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@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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Fri, 14 Jul 2017 09:21:06 GMT) (full text, mbox, link).


Acknowledgement sent to gisl@leonde.de:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Fri, 14 Jul 2017 09:21:06 GMT) (full text, mbox, link).


Message #30 received at 864074@bugs.debian.org (full text, mbox, reply):

From: gisl@leonde.de
To: 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Fri, 14 Jul 2017 11:11:00 +0200
I can only agree with Martin.

Getting your local configuration overwritten is very irritating and 
unexpected. Defaults are there to be overridden by local configuration, not 
the other way round.

The broken copy&paste scenario needs fixing on *every* headless Debian Stretch 
installation, which is very tedious.

Thanks
Carsten




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Wed, 19 Jul 2017 23:51:03 GMT) (full text, mbox, link).


Acknowledgement sent to James McCoy <jamessan@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Wed, 19 Jul 2017 23:51:03 GMT) (full text, mbox, link).


Message #35 received at 864074@bugs.debian.org (full text, mbox, reply):

From: James McCoy <jamessan@debian.org>
To: Martin Steigerwald <martin@lichtvoll.de>
Cc: 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Wed, 19 Jul 2017 19:49:16 -0400
On Wed, Jul 19, 2017 at 11:38:40PM +0200, Martin Steigerwald wrote:
> James, did you intend to send this just to me?

I didn't.

> To be on safe side, I reply to 
> you only, but I really think this should also go to the bug report.

Agreed. I'll bounce the last two messages to the bug.

> James McCoy - 18.07.17, 20:21:
> > On Sat, Jul 08, 2017 at 11:36:07PM +0200, Martin Steigerwald wrote:
> > > James McCoy - 05.07.17, 21:09:
> […]
> > > 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.
> > 
> > Then you would actually want defaults.vim to be first, so that anything
> > else set overrides it.  You can do exactly that by putting this in your
> > /etc/vim/vimrc.local:
> > 
> >     " Explicitly source defaults.vim so you can override its settings
> >     source $VIMRUNTIME/defaults.vim
> >     " Prevent it from being loaded again later if the user doesn't have
> >     " a vimrc
> >     let skip_defaults_vim = 1
> 
> And all that just to restore some sanity to the VIM configuration… well…

I understand the feeling, but I also dislike deviating from default
configurations since that makes it harder for people to switch between
systems.  That's why I've suggested raising the issue upstream.

> > > 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.
> > 
> > Yes, that was another part that Bram just punted on when he was deciding
> > how defaults.vim would work.
> 
> I may look at a vim fork that doesn´t adopt this nonsense.

Neovim bakes in saner defaults, which avoids all this jumping through
hoops when you want to deviate from them.

> But the issue with this is: Now by default the VIM configuration is *broken* in 
> several ways which I described on *every* newly installed *or* upgraded Debian 
> system. Which needs adapting the configuration every newly installed system.
> 
> For *what* benefit?

Many of the changes *are* useful to enable, but 'mouse' in particular
was a poor choice and the interaction with system-wide vimrc was an even
poorer one.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Wed, 19 Jul 2017 23:54:02 GMT) (full text, mbox, link).


Acknowledgement sent to James McCoy <jamessan@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Wed, 19 Jul 2017 23:54:02 GMT) (full text, mbox, link).


Message #40 received at 864074@bugs.debian.org (full text, mbox, reply):

From: James McCoy <jamessan@debian.org>
To: Martin Steigerwald <martin@lichtvoll.de>
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Tue, 18 Jul 2017 20:21:19 -0400
On Sat, Jul 08, 2017 at 11:36:07PM +0200, Martin Steigerwald wrote:
> James McCoy - 05.07.17, 21:09:
> > 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.

Then you would actually want defaults.vim to be first, so that anything
else set overrides it.  You can do exactly that by putting this in your
/etc/vim/vimrc.local:

    " Explicitly source defaults.vim so you can override its settings
    source $VIMRUNTIME/defaults.vim
    " Prevent it from being loaded again later if the user doesn't have
    " a vimrc
    let skip_defaults_vim = 1
    " Disable the settings you don't like
    set mouse=

> 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.

Yes, that was another part that Bram just punted on when he was deciding
how defaults.vim would work.

> > 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.

/etc/vim/vimrc is the only thing Vim knows about.  It just happens to
have a snippet at the end which sources /etc/vim/vimrc.local.

If anything, I'll add a commented out version of the code I posted
above to /etc/vim/vimrc.  I thought this sort of stuff would be easily
figured out for people that wanted to customize the behavior, but
apparently I was wrong.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Wed, 19 Jul 2017 23:54:04 GMT) (full text, mbox, link).


Acknowledgement sent to Martin Steigerwald <martin@lichtvoll.de>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Wed, 19 Jul 2017 23:54:04 GMT) (full text, mbox, link).


Message #45 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Martin Steigerwald <martin@lichtvoll.de>
To: James McCoy <jamessan@debian.org>
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Wed, 19 Jul 2017 23:38:40 +0200
James, did you intend to send this just to me? To be on safe side, I reply to 
you only, but I really think this should also go to the bug report.

James McCoy - 18.07.17, 20:21:
> On Sat, Jul 08, 2017 at 11:36:07PM +0200, Martin Steigerwald wrote:
> > James McCoy - 05.07.17, 21:09:
[…]
> > 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.
> 
> Then you would actually want defaults.vim to be first, so that anything
> else set overrides it.  You can do exactly that by putting this in your
> /etc/vim/vimrc.local:
> 
>     " Explicitly source defaults.vim so you can override its settings
>     source $VIMRUNTIME/defaults.vim
>     " Prevent it from being loaded again later if the user doesn't have
>     " a vimrc
>     let skip_defaults_vim = 1

And all that just to restore some sanity to the VIM configuration… well…

> > 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.
> 
> Yes, that was another part that Bram just punted on when he was deciding
> how defaults.vim would work.

I may look at a vim fork that doesn´t adopt this nonsense.

> > > 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.
> /etc/vim/vimrc is the only thing Vim knows about.  It just happens to
> have a snippet at the end which sources /etc/vim/vimrc.local.
> 
> If anything, I'll add a commented out version of the code I posted
> above to /etc/vim/vimrc.  I thought this sort of stuff would be easily
> figured out for people that wanted to customize the behavior, but
> apparently I was wrong.

This is… I already use "let skip_defaults_vim = 1". I found this before 
already, and I think apt-listchanges showed me your update to NEWS.Debian.

But the issue with this is: Now by default the VIM configuration is *broken* in 
several ways which I described on *every* newly installed *or* upgraded Debian 
system. Which needs adapting the configuration every newly installed system.

For *what* benefit?

Well, I bet I´d need to file an issue with upstream about that.

Thanks,
-- 
Martin



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Thu, 20 Jul 2017 22:51:02 GMT) (full text, mbox, link).


Acknowledgement sent to Adam Waite <awaite@dailyinsightgroup.com>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Thu, 20 Jul 2017 22:51:03 GMT) (full text, mbox, link).


Message #50 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Adam Waite <awaite@dailyinsightgroup.com>
To: 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Thu, 20 Jul 2017 15:46:39 -0700
[Message part 1 (text/plain, inline)]
As mentioned on other bug reports, this is an order-of-inclusion issue.

  1: /usr/share/vim/vimrc
  2: /usr/share/vim/vim80/debian.vim
  3: /etc/vim/vimrc.local
  4: /usr/share/vim/vim80/defaults.vim
  [snip]

defaults.vim is being loaded *after* vimrc.local, which means that
vimrc.local is useless for overriding the package default settings. This is
not the expected behavior.

Suggesting that each individual user on a system should supply their own
.vimrc is a ridiculous non-solution, especially since the functionality
exists to set system-wide defaults.

Prematurely closed bugs:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=837761
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=837880

The solution is simple, and it is simply baffling that it has been resisted
by the package maintainers. Why should users have to completely disable the
defaults, just to disable a single problematic configuration item?
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Fri, 21 Jul 2017 02:27:04 GMT) (full text, mbox, link).


Acknowledgement sent to James McCoy <jamessan@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Fri, 21 Jul 2017 02:27:04 GMT) (full text, mbox, link).


Message #55 received at 864074@bugs.debian.org (full text, mbox, reply):

From: James McCoy <jamessan@debian.org>
To: Adam Waite <awaite@dailyinsightgroup.com>, 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Thu, 20 Jul 2017 22:24:01 -0400
On Thu, Jul 20, 2017 at 03:46:39PM -0700, Adam Waite wrote:
> As mentioned on other bug reports, this is an order-of-inclusion issue. 
> 
>   1: /usr/share/vim/vimrc
>   2: /usr/share/vim/vim80/debian.vim
>   3: /etc/vim/vimrc.local
>   4: /usr/share/vim/vim80/defaults.vim
>   [snip]
> 
> defaults.vim is being loaded *after* vimrc.local, which means that vimrc.local
> is useless for overriding the package default settings. This is not the
> expected behavior. 
> 
> The solution is simple, and it is simply baffling that it has been resisted by
> the package maintainers. Why should users have to completely disable the
> defaults, just to disable a single problematic configuration item? 

There's no need to disable defaults.vim.  As I have also suggested (in
this very bug report), you can explicitly load defaults.vim and then
disable whatever settings you don't like.

Changing this behavior _just_ for Debian will only add to the confusion,
since users will now get different behavior on different systems.
Upstream needs to be convinced that this is a problem, so it can be
addressed there.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Fri, 21 Jul 2017 12:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to Igor Sverkos <igor.sverkos@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Fri, 21 Jul 2017 12:27:03 GMT) (full text, mbox, link).


Message #60 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Igor Sverkos <igor.sverkos@gmail.com>
To: 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Fri, 21 Jul 2017 14:25:46 +0200
Hi,

On Thu, 20 Jul 2017 22:24:01 -0400 James McCoy <jamessan@debian.org> wrote:

> There's no need to disable defaults.vim.  As I have also suggested (in
> this very bug report), you can explicitly load defaults.vim and then
> disable whatever settings you don't like.

I hit the same problem. Maybe I don't understand your suggestion. Could
you please explain it in more details?

My problem:
===========
We have a network running ~600 Debian boxes at the moment.

We are using Puppet for configuration management.

I now want to deploy a default system-wide VIM configuration which can
be overwritten by the user using ~/.vimrc.

How am I supposed to do that?

I would expect to alter "/etc/vim/vimrc" respective
"/etc/vim/vimrc.local" but this doesn't work when
"/usr/share/vim/vim80/defaults.vim" will be sourced as last
configuration file.


-- 
Regards,
Igor



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Fri, 21 Jul 2017 12:57:03 GMT) (full text, mbox, link).


Acknowledgement sent to Martin Steigerwald <martin@lichtvoll.de>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Fri, 21 Jul 2017 12:57:03 GMT) (full text, mbox, link).


Message #65 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Martin Steigerwald <martin@lichtvoll.de>
To: 864074@bugs.debian.org, Igor Sverkos <igor.sverkos@gmail.com>
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Fri, 21 Jul 2017 14:53:56 +0200
[Message part 1 (text/plain, inline)]
Igor Sverkos - 21.07.17, 14:25:
> Hi,
> 
> On Thu, 20 Jul 2017 22:24:01 -0400 James McCoy <jamessan@debian.org> wrote:
> > There's no need to disable defaults.vim.  As I have also suggested (in
> > this very bug report), you can explicitly load defaults.vim and then
> > disable whatever settings you don't like.
> 
> I hit the same problem. Maybe I don't understand your suggestion. Could
> you please explain it in more details?
> 
> My problem:
> ===========
> We have a network running ~600 Debian boxes at the moment.
> 
> We are using Puppet for configuration management.
> 
> I now want to deploy a default system-wide VIM configuration which can
> be overwritten by the user using ~/.vimrc.
> 
> How am I supposed to do that?
> 
> I would expect to alter "/etc/vim/vimrc" respective
> "/etc/vim/vimrc.local" but this doesn't work when
> "/usr/share/vim/vim80/defaults.vim" will be sourced as last
> configuration file.

Well that one is actually documented in README.Debian as pointed out here in 
this bug report several times already. Add

let g:skip_defaults_vim = 1

at the beginning of "/etc/vim/vimrc.local".

And that is not really the issue of this bug report.

The issue is, that it is required to have a work-around like this, or the one 
James suggested – where it will if I understand correctly load defaults.vim 
before making changes to it –, in order to have a sane behavior. Since I use 
Linux, configuration loading always worked from global to local. Here it does 
not, unless you add a work-around.

This has been an upstream decision according to James and I think its best to 
bring this issue to upstream. If upstream does not adapt the behavior, I am 
all for a patch in the Debian package, but it seems James thinks differently 
on that one. Another option would be to vote about that new behavior by 
switching to neovim.

Thanks,
-- 
Martin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Fri, 21 Jul 2017 13:12:02 GMT) (full text, mbox, link).


Acknowledgement sent to James McCoy <jamessan@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Fri, 21 Jul 2017 13:12:02 GMT) (full text, mbox, link).


Message #70 received at 864074@bugs.debian.org (full text, mbox, reply):

From: James McCoy <jamessan@debian.org>
To: Igor Sverkos <igor.sverkos@gmail.com>, 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Fri, 21 Jul 2017 09:08:16 -0400
On Fri, Jul 21, 2017 at 02:25:46PM +0200, Igor Sverkos wrote:
> Hi,
> 
> On Thu, 20 Jul 2017 22:24:01 -0400 James McCoy <jamessan@debian.org> wrote:
> 
> > There's no need to disable defaults.vim.  As I have also suggested (in
> > this very bug report), you can explicitly load defaults.vim and then
> > disable whatever settings you don't like.
> 
> I hit the same problem. Maybe I don't understand your suggestion. Could
> you please explain it in more details?
> 
> My problem:
> ===========
> We have a network running ~600 Debian boxes at the moment.
> 
> We are using Puppet for configuration management.
> 
> I now want to deploy a default system-wide VIM configuration which can
> be overwritten by the user using ~/.vimrc.
> 
> How am I supposed to do that?

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864074#40

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Fri, 21 Jul 2017 13:21:04 GMT) (full text, mbox, link).


Acknowledgement sent to Martin Steigerwald <martin@lichtvoll.de>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Fri, 21 Jul 2017 13:21:04 GMT) (full text, mbox, link).


Message #75 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Martin Steigerwald <martin@lichtvoll.de>
To: 864074@bugs.debian.org
Cc: Igor Sverkos <igor.sverkos@gmail.com>
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Fri, 21 Jul 2017 15:17:29 +0200
[Message part 1 (text/plain, inline)]
Martin Steigerwald - 21.07.17, 14:53:
> The issue is, that it is required to have a work-around like this, or the
> one  James suggested – where it will if I understand correctly load
> defaults.vim before making changes to it –, in order to have a sane
> behavior. Since I use Linux, configuration loading always worked from
> global to local. Here it does not, unless you add a work-around.
> 
> This has been an upstream decision according to James and I think its best
> to  bring this issue to upstream. If upstream does not adapt the behavior,
> I am all for a patch in the Debian package, but it seems James thinks
> differently on that one. Another option would be to vote about that new
> behavior by switching to neovim.

I tested configuration for neovim by copying contents of /etc/vim/vimrc.local 
to /etc/xdg/nvim/init.vim (strange location for config file if you ask me) and 
removing the defaults.vim work-around. This basically works just fine. I just 
did "set mouse=" as neovim also enables it by default. But nvim respects this 
without any work-around. It doesn´t seem to have the defaults.vim thing.

I also used update-alternatives --config vim to switch to nvim by default.

Lets see how that works.

This will just be my work-around for my laptop for now.

-- 
Martin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Sat, 02 Sep 2017 07:51:06 GMT) (full text, mbox, link).


Acknowledgement sent to Ralph Aichinger <ra@pi.h5.or.at>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Sat, 02 Sep 2017 07:51:06 GMT) (full text, mbox, link).


Message #80 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Ralph Aichinger <ra@pi.h5.or.at>
To: 864074@bugs.debian.org
Subject: Ist there a way to get a change of this setting considered?
Date: Sat, 2 Sep 2017 09:25:07 +0200
I think this is an especially unwisely chosen default, as others
have written, it is not a problem for actual personal user accounts,
but for root accounts on yet unconfigured Debian boxes.

Would it be possible to ship an empty .vimrc for root and the first
account created during setup, e.g. by inserting an empty .vimrc into
/etc/skel?

Even in situations where Boxes are hooked up to Ansible or another
configuration management system, vim is the one software I need to
work right away without annoying me ;)

Thanks for considering,
/ralph 



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Sat, 23 Sep 2017 12:51:06 GMT) (full text, mbox, link).


Acknowledgement sent to Chris Zubrzycki <debian@mid-earth.net>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Sat, 23 Sep 2017 12:51:06 GMT) (full text, mbox, link).


Message #85 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Chris Zubrzycki <debian@mid-earth.net>
To: 864074@bugs.debian.org
Subject: I agree
Date: Sat, 23 Sep 2017 08:43:44 -0400
I agree with most of this bug report. The config system is backwards, broken, and confusing. There needs to be the equivalent of the solution pasted here adopted as the default configuration.

" Explicitly source defaults.vim so you can override its settings
source $VIMRUNTIME/defaults.vim
" Prevent it from being loaded again later if the user doesn't have
" a vimrc
let skip_defaults_vim = 1
" Disable the settings you don't like
“ set mouse=

should be there as a default. Either fixed inthe code, or as the debian default config file. Just because upstream does a boneheaded thing, doesn’t mean it’s a package manager’s responsibility to blindly follow it. Debian changes defaults and packages all the time to fit the way Debian does things, and the way Debian uses expect. I try to limit my terminal use to Debian and OS X. I couldn’t care less what RedHat does with it’s vim settings.

Please change it so people don’t have to reconfigure every box they use to a sane default.


-chris zubrzycki
- --
PGP ID: 0xA2ABC070
Fingerprint: 26B0 BA6B A409 FA83 42B3  1688 FBF9 8232 A2AB C070
========================================================

Unix  _IS_  user friendly... It's just selective about who its friends are.






Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Sat, 28 Oct 2017 01:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to Mark Abrahams <mark@abrahams.co.nz>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Sat, 28 Oct 2017 01:27:04 GMT) (full text, mbox, link).


Message #90 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Mark Abrahams <mark@abrahams.co.nz>
To: 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Sat, 28 Oct 2017 14:23:32 +1300
Hi

On Thu, 20 Jul 2017 22:24:01 -0400 James McCoy <jamessan@debian.org> wrote:
> On Thu, Jul 20, 2017 at 03:46:39PM -0700, Adam Waite wrote:
> > As mentioned on other bug reports, this is an order-of-inclusion 
issue.
> >
> >   1: /usr/share/vim/vimrc
> >   2: /usr/share/vim/vim80/debian.vim
> >   3: /etc/vim/vimrc.local
> >   4: /usr/share/vim/vim80/defaults.vim
> >   [snip]
> >
> > defaults.vim is being loaded *after* vimrc.local, which means that 
vimrc.local
> > is useless for overriding the package default settings. This is not the
> > expected behavior.
> >
> > The solution is simple, and it is simply baffling that it has been 
resisted by
> > the package maintainers. Why should users have to completely 
disable the
> > defaults, just to disable a single problematic configuration item?
>
> There's no need to disable defaults.vim. As I have also suggested (in
> this very bug report), you can explicitly load defaults.vim and then
> disable whatever settings you don't like.
>
> Changing this behavior _just_ for Debian will only add to the confusion,
> since users will now get different behavior on different systems.
> Upstream needs to be convinced that this is a problem, so it can be
> addressed there.
>
> Cheers,
> --
> James
> GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB
>
>

Thanks for your helpful explanation on the issue here James, but let me 
add my agreement to the general sentiment in this thread: I believe that 
the vim behavior here is problematic to the point of warranting a change 
in the Debian package.

Forgive the proceeding monologue, but I'll try to illustrate with my 
case. I'm doing my first build of a stretch rollout, which involves 
building and populating LDAP, so no user accounts at this point - all 
just root and an "ansible" user to get things started.  Just wanting to 
get things done, I'm a little disappointed when I discover that 
mouse-based copy to the system clipboard is broken. It annoys me, but 
with the actual in-flight task at hand of building LDAP, etc., and a 
complete lack of appetite to fight vim, I make the shortsighted decision 
to work around this by exiting vim and cat'ing/grep'ing whenever I want 
to copy stuff out of a file.  At some point the annoyance threshold for 
this productivity hit is breached - and I stop what I'm doing to 
research and find the "set mouse=" workaround.  I confirm this works in 
running vim, and then add to /etc/vim/vimrc.local.  Which doesn't work.  
I'm off-task now anyway, so I keep googling my way ultimately to this 
thread - which is fanastic BTW - read the note about defaults.vim at the 
top of the system vimrc file, make a guess at what $VIMRUNTIME is, find 
defaults.vim, find the "set mouse=a" line in the defaults, confirming 
that is overriding my vimrc.local setting, add "let g:skip_defaults_vim 
= 1" to vimrc.local, and the copy function is permanently restored.  I 
then write up a quick ansible role to fix this across all systems, test 
the role, and roll it out.  Then write this email, due to some strong 
but hopefully helpful feelings on the subject.  Time wasted all up: 
probably about 2 hours, some of it due to a with-hindsight poor decision 
to not troubleshoot and fix the issue immediately.  I'd hazard a guess 
that I'm a reasonably typical engineer here, just wanting to get work 
done with tools that had worked for me previously.  So multiply that 
sort of time wasted by the number of people hitting the same thing 
first-time installing stretch.

Compare that with the potential confusion you have sighted with 
cross-system consistency with a divergence from upstream:
(a) I'd wager that the amount of collective time waste would pale in 
comparison to that inherent in the the current situation, and
(b) any confusion issues aren't Debian's problem, if you make Debian 
work how 99% of the user base would expect.  The onus is on other system 
owners to provide a good experience for their user base.

Debian working in an intuitive way carries less confusion than Debian 
working in a completely counterintuitive and counterproductive way 
consistent with an upstream.

Kind regards
Mark




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>:
Bug#864074; Package vim. (Mon, 11 Jun 2018 10:51:03 GMT) (full text, mbox, link).


Acknowledgement sent to Rudi Daemen <info@kratjebierhosting.nl>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>. (Mon, 11 Jun 2018 10:51:03 GMT) (full text, mbox, link).


Message #95 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Rudi Daemen <info@kratjebierhosting.nl>
To: 864074@bugs.debian.org
Subject: Bug#864074: defaults.vim: broken configuration
Date: Mon, 11 Jun 2018 12:41:42 +0200
Hi all,

For all of those that are googling for this issue and want a quick 
work-around in place until the order-of-inclusion is fixed upstream, I 
have added the following two lines to the beginning of the system-wide 
vimrc.local on all debian servers I am managing:

runtime! defaults.vim
let g:skip_defaults_vim = 1

The first line, ofcourse, is only needed if you actually want some of 
the values from the "defaults.vim" file, otherwise it can be omitted. 
The second line avoids it from being loaded again at any later stage. I 
can confirm this works as it does load the defaults.vim (and thus some 
config options I do like) but it does this before processing the 
remainder in vimrc.local. As a result, it now no longer overrides any 
config options I did not like and thus changed in vimrc.local (e.g. set 
mouse=).

Just adding these two lines to the vimrc.local file resolved my problems 
with vim.

Kind regards,
Rudi



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <team+vim@tracker.debian.org>:
Bug#864074; Package vim. (Tue, 26 May 2020 12:51:02 GMT) (full text, mbox, link).


Acknowledgement sent to Martin Steigerwald <martin@lichtvoll.de>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <team+vim@tracker.debian.org>. (Tue, 26 May 2020 12:51:02 GMT) (full text, mbox, link).


Message #100 received at 864074@bugs.debian.org (full text, mbox, reply):

From: Martin Steigerwald <martin@lichtvoll.de>
To: 864074@bugs.debian.org, James McCoy <jamessan@debian.org>
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Tue, 26 May 2020 14:42:18 +0200
Dear James.

James McCoy - 06.07.17, 03:09:23 CEST:
> > 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.

Finally I found this one. It is:

% grep filetype /usr/share/vim/vim82/defaults.vim 
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" Revert with ":filetype off".
filetype plugin indent on

It triggers for example for editing Git commit messages. And no, I don't 
like command line output to be wrapped in there.

Thus I did:

% cat /etc/vim/vimrc.local 
[…]
" 'set mouse=' in /etc/vim/vimrc.local is ignored unless ~/.vimrc exists
" https://bugs.debian.org/864074
runtime! defaults.vim
let g:skip_defaults_vim = 1
[…]
:filetype plugin indent off
[…]

Let's hope no other unexpected configuration changes creep in by using 
defaults.vim – otherwise I may reconsider having 'runtime! defaults.vim' 
in 'vimrc.local', so far I am not sure it gives me any substantial 
benefits over just using my own configuration.

I am also not sure whether I really like incremental search so far. 
Let's see.

I am still not convinced that the current handling of 'vimrc.local' is 
Debian user friendly.

Ciao,
-- 
Martin





Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <team+vim@tracker.debian.org>:
Bug#864074; Package vim. (Fri, 10 Jul 2020 15:39:03 GMT) (full text, mbox, link).


Acknowledgement sent to b0ns <ivan@b0ns.at>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <team+vim@tracker.debian.org>. (Fri, 10 Jul 2020 15:39:03 GMT) (full text, mbox, link).


Message #105 received at 864074@bugs.debian.org (full text, mbox, reply):

From: b0ns <ivan@b0ns.at>
To: "864074@bugs.debian.org" <864074@bugs.debian.org>
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Fri, 10 Jul 2020 15:28:22 +0000
[Message part 1 (text/plain, inline)]
Hello,

I always refrained from extrapolating feedback or a complaint about this issue but:
It is now 3 years that i'm typing "set mouse=" every time I open a file with VIM on debian while swearing!

Was this the intended result after this change?

This setting broke things and that's it, I wonder where the improvement has been and for who.

This settings is unmanageable for any debian system since stretch, we have hundreds of servers and we never managed to push through any workaround for this, not even have resources to invest on such change.

It doesn't seem there is any advantage and people is constantly swearing about this debian change every time they open VIM, not only me! every colleague or person working with debian is reporting the same problem and swearing about this change and why it went through.

So I would like to gently ask to SERIOUSLY review the situation about this and EVALUATE AGAIN to go toward an upstream change to restore NORMAL USABILITY for 99% of the users and companies using debian systems.

If after 3 years we are still typing "set mouse=" (every time I open a file with vim) ,like many other users do ,there must be a reason and really a big problem somewhere!

to not even mention people falling back to CAT for copying the content of a file, or even NANO just because of this change.

[Message part 2 (text/html, inline)]
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Vim Maintainers <team+vim@tracker.debian.org>:
Bug#864074; Package vim. (Sat, 11 Jul 2020 14:00:03 GMT) (full text, mbox, link).


Acknowledgement sent to James McCoy <jamessan@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Vim Maintainers <team+vim@tracker.debian.org>. (Sat, 11 Jul 2020 14:00:03 GMT) (full text, mbox, link).


Message #110 received at 864074@bugs.debian.org (full text, mbox, reply):

From: James McCoy <jamessan@debian.org>
To: b0ns <ivan@b0ns.at>, 864074@bugs.debian.org
Subject: Re: Bug#864074: defaults.vim: broken configuration
Date: Sat, 11 Jul 2020 09:57:33 -0400
On Fri, Jul 10, 2020 at 03:28:22PM +0000, b0ns wrote:
> Hello,
> 
> I always refrained from extrapolating feedback or a complaint about this issue but:
> It is now 3 years that i'm typing "set mouse=" every time I open a file with VIM on debian while swearing!
> 
> Was this the intended result after this change?

You would need to talk to Bram about that, as I've previously stated in
this bug report.

> This settings is unmanageable for any debian system since stretch, we
> have hundreds of servers and we never managed to push through any
> workaround for this, not even have resources to invest on such change.

Presumably you're using some sort of orchestration, like Puppet.  In
that case, simply add "let g:skip_defaults_vim = 1" to
/etc/vim/vimrc.local, as is documented in this bug report,
NEWS.Debian.gz, and /etc/vim/vimrc.

> It doesn't seem there is any advantage and people is constantly
> swearing about this debian change every time they open VIM, not only
> me!

This is NOT a Debian-specific change.  It is an upstream change, which I
have argued against many times because of many of the issues raised here
and in other bug reports.  Bram has refused to accept my suggestions,
basically stating that "changing it now would break people's configs
that are used to it".

I'm just as frustrated as everyone else with the way this was
implemented, but this is not something I'm going to change just in
Debian.

This is one of many reasons that I generally use neovim now, rather than
Vim.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB



Reply sent to James McCoy <jamessan@debian.org>:
You have taken responsibility. (Fri, 11 Mar 2022 00:24:04 GMT) (full text, mbox, link).


Notification sent to Andreas Beckmann <anbe@debian.org>:
Bug acknowledged by developer. (Fri, 11 Mar 2022 00:24:05 GMT) (full text, mbox, link).


Message #115 received at 864074-done@bugs.debian.org (full text, mbox, reply):

From: James McCoy <jamessan@debian.org>
To: Otheus <otheus.shelling@uibk.ac.at>, 1007007-done@bugs.debian.org, 864074-done@bugs.debian.org
Subject: Re: Bug#1007007: vim: defaults.vim items should not override those in vimrc.local and home/.vimrc
Date: Thu, 10 Mar 2022 19:20:04 -0500
On Thu, Mar 10, 2022 at 02:42:34PM +0100, Otheus wrote:
> The load-order indicated by :version

No, :version just reports locations of files, not their load order.

> This is a generalization of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864074

As I've described numerous times in that bug, this needs to be fixed
upstream.  Deviating in Debian just adds to the confusion.

I'm closing both bugs, since upstream seems pretty set in their
decision.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 08 Apr 2022 07:27:29 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri May 3 09:16:56 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.