With version v0.10.0 of Neovim, the `:verbose` output added
"(run Nvim with -V1 for more details)" to the previous message,
which was simply "Last set from Lua".
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.
The shiftround setting breaks many common cases of multi-line indent and
outdent for continuation lines. For example, suppose I have the
following code, in a buffer with 8-space indentation:
foo(x,
y)
With the default settings, I can > those two lines, and end up with this:
foo(x,
y);
But with shiftround, I instead end up with:
foo(x,
y);
Thus, revert to the vim default of noshiftround.
* Break undo after CTRL-U.
* Set shiftround.
* Set tabpagemax=50.
* Set nrformats-=octal.
* Set sessionoptions-=options.
* Set history=1000.
* Set ttimeoutlen=100.
* Set encoding=utf-8 in gvim.
* Override shell=fish to use a supported shell instead.
* Use ASCII only listchars.
* Drop fillchars.
* Drop smartcase.
* Drop autowrite.
* Drop showmatch.
* Drop Y mapping.
* Don't clobber scroll offsets.
* Don't override a blank viminfo.
* Don't force UNIX line endings on Windows.
* Stop setting temporary directories.
As discussed in Issue #57, setting Unicode characters for
`listchars` is a problematic default because of the scrolling
performance impact incurred when one of the specified glyphs is missing
from the user's selected font.
An alternative approach would be to choose "safer" unicode characters
that are likely to exist in most fonts. Given that the purpose of
vim-sensible is to provide universal sane defaults it seems this would
be best left to the user's `.vimrc` or another plugin.