Wednesday, July 3, 2019

Re: Recent showcmd change?

On Wed, Jul 03, 2019 at 03:52:28AM +0200, Tony Mechelynck wrote:
>On Tue, Jul 2, 2019 at 6:07 PM Paul <vim91549@rainslide.net> wrote:
>>
>[...]
>>
>> I then noticed that the help says that showcmd is enabled by default in Vim (not sure when that change was made), but when I run `vim -Nu NONE`, `:verbose set showcmd?` shows "noshowcmd". `:scriptnames` confirms no files were loaded, and `:compatible` shows "nocompatible". Am I misunderstanding something there?
>
>-N -u NONE means "load no vimrc or gvimrc, but start in 'nocompatible'
>mode". However, since version 8, when you start Vim with no
>command-line switches, then if it finds no vimrc it will source the
>$VIMRUNTIME/defaults.vim script, which contains what used to be in
>$VIMRUNTIME/vimrc_example.vim (the latter still exists for
>compatibility, but nowadays it just sources the former). See ":help
>incompatible-8" for details.
>
>There is also a new -u argument value: "vim -u DEFAULTS" will source
>the defaults.vim, disregarding any user vimrc, thus starting Vim in a
>reproducible way in a modern user-friendly environment. With Vim 7 or
>earlier, you could achieve an equivalent result by (e.g. for Vim 7.4
>on Unix) "vim -u /usr/local/share/vim/vim74/vimrc_example.vim". (In
>that case, -N is not necessary because the first non-comment line of
>the erstwhile vimrc_example.vim used to be "set nocompatible".)

Thanks, Tony. This is why I looked at `:scriptnames` — to be sure that defaults.vim wasn't affecting what I was seeing. So, rather than the observed behaviour being different to what I expected, it was my reading of the documentation that was wrong.

This is confusing.

When the :help says "Vim default: …, set in defaults.vim", we don't really know what the real default is. Using 'showcmd' as an example, if I create a vimrc that contains only "set wrap", and run `vim`, 'showcmd' is off — the real default, which isn't mentioned in `:help 'showcmd'`.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190703104703.GA13223%40rainslide.net.
For more options, visit https://groups.google.com/d/optout.

No comments: