Neovim users since version 0.5 can write their global configuration in
an ~/.config/nvim/init.lua file instead of ~/.config/nvim/init.vim.
Unfortunately, `:verbose` support for Lua is still lacking even in
Neovim 0.8: instead of reporting the file and line that last changed an
option, it will simply say "last set in Lua" if that change happened in
a Lua script.
The regex used in MaySet does not recognize this case and so MaySet
falsely assumes that all Lua config comes from the system and not from
the user.
I've gone for a somewhat hacky solution and simply added the alternative
`/ Lua$/` to the regex. This assumes that the system-wide vimrc file is
always written in VimScript – which is true to this day according to the
[Neovim documentation][1].
[1]: https://github.com/neovim/neovim/blob/ce0fddf5/runtime/doc/starting.txt#L468-L472
Co-authored-by: Nico Madysa <nico.madysa@cern.ch>
* Try to avoid overriding options set in user vimrc.
* Provide :DiffOrig, as found in the example at `:help :DiffOrig`.
* Enable Vim's included :Man command.
* Enable g:is_posix, for better highlighting of sh filetype.
* Break undo with <C-G>u before delete word with <C-W>.
* Add `set viewoptions-=options`.
* Add `set display+=truncate`.
* Add `set nolangremap`.
* Add `set nocompatible`.
* Replace `set sidescrolloff=5` with `set sidescroll=1 sidescrolloff=2`.
* Remove `set autoindent`.
* Remove conditional `set encoding=utf-8`.
* Don't run `filetype plugin indent on` a second time.
While `:runtime plugin/sensible.vim` does allow for effectively
superseding any option set by sensible.vim, it has never sat right with
me that this was necessary. This change attempt to use the output of
`:verbose set` to determine if an option should be overridden or not.
Excluded from this change is options we alter, rather than override,
since a user could conceivably have their own alterations that do not
conflict with sensible.vim. If any of these alterations were to receive
pushback, I would reconsider this decision.
References: https://github.com/tpope/vim-sensible/issues/129
References: https://github.com/tpope/vim-sensible/issues/88
This seems like a weirdly specific thing to provide in a set of
defaults, but since defaults.vim provides it I guess we can too.
References: https://github.com/tpope/vim-sensible/issues/86
This matches what defaults.vim does. We could omit "lastline" in this
case, but it doesn't hurt anything, and keeping it out of an if
statement allows it to be set without +eval.
Vim 8.2.2912 changes the default on Windows, eliminating the primary
issue this was intended to fix. Changing 'encoding' can prevent
previously defined maps from working, so let's rip this out sooner
rather than later.
References: https://github.com/tpope/vim-sensible/issues/69
It's only very rarely that I want this off, but since file type plugins
tend to turn it on when it's desirable, the argument for forcing it
globally is pretty weak.
* Enable upwards tags file searching with `./tags;` in 'tags'.
* Enable joining commented lines with `formatoptions` j flag.
* Remove 'showcmd', 'shiftround', and 'fileformat' changes.
* Allow fish as 'shell' for compatible Vim versions.
* Don't override user specified 'ttimeoutlen'.
* Don't force `t_Co` to 16 for Eterm.
* Add :diffupdate to CTRL-L map.
As of 7.4.276, Vim understands how to run commands in subshells when
'shell' is fish. This fixes the most common problems with running
external commands from Vim.
Plugins may still need to accommodate for fish, but fixing the cognitive
dissonance of having the user's shell changed outweighs the benefit to
lazy plugin writers.