I realize this might be an upstream issue, but I figure I'll ask here before sounding alarms up top. I use VIM in the console. I don't like VIM's mouse support, so I don't use it. I never had to deal with it in VIM 7, but it's snuck its way into VIM 8 in a very odd fashion. When I run `vim some/file` mouse mode is bizarrely and very unfortunately enabled. Putting 'set mouse=' in /etc/vim/vimrc.local doesn't seem to have an impact. However, I can turn mouse mode off for each instance of root VIM by running ":set mouse=" everytime I start th eprogram. Of course, this is a PITA, and in the first place I don't want it to be on, ever. Note that this is with nearly vanilla VIM; I don't have any customisations. I don't even have a ~/.vimrc... What makes it all the more perplexing is that this bug goes away if I run: $ touch ~/.vimrc In other words, if ~/.vimrc exists, the bug goes away, no matter if that file is actually empty. Very perplexing indeed. Any ideas?
Okay, trudging through the VIM source code, apparently if there's no ~/.vimrc, then it sources /usr/share/vim/vim80/defaults.vim. It's either/or. That's weird behavior! That file has this in it: " Bail out if something that ran earlier, e.g. a system wide vimrc, does not " want Vim to use these default values. if exists('skip_defaults_vim') finish endif Perhaps this belongs in /etc/vim/vimrc?
> I don't even have a ~/.vimrc... :help defaults.vim If Vim is started normally and no user vimrc file is found, the $VIMRUTIME/defaults.vim script is loaded. This will set 'compatible' off, switch on syntax highlighting and a few more things. See the script for details. NOTE: this is done since Vim 8.0, not in Vim 7.4. (it was added in patch 7.4.2111 to be exact). and 'set mouse=a' is in defaults.vim, see ':help mouse'.
Yes, okay, so this is new in VIM 8. Apparently we should be putting 'let g:skip_defaults_vim = 1' in /etc/vim/vimrc. I can confirm this fixes the problem. Mind if I merge this and revbump the build? diff --git a/app-editors/vim-core/files/vimrc-r4 b/app-editors/vim-core/files/vimrc-r4 index 07fffcc..fdc316b 100644 --- a/app-editors/vim-core/files/vimrc-r4 +++ b/app-editors/vim-core/files/vimrc-r4 @@ -190,6 +190,10 @@ augroup END endif " has("autocmd") " }}} +" We don't want VIM to load their own built-in defaults, preferring ours here +" instead: +let g:skip_defaults_vim = 1 + " {{{ vimrc.local if filereadable("@GENTOO_PORTAGE_EPREFIX@/etc/vim/vimrc.local") source @GENTOO_PORTAGE_EPREFIX@/etc/vim/vimrc.local
10:44:12 @monsieurp | zx2c4: hi! wrt your vim patch it LGTM commit c7caaf374650078707df8ce9b313e967ceff56f6 Author: Jason A. Donenfeld <zx2c4@gentoo.org> Date: Tue Sep 20 20:02:44 2016 +0200 app-editors/vim-core: don't use vim's defaults (bug #594292)