Recent showcmd change?

56 views
Skip to first unread message

Paul

unread,
Jul 2, 2019, 12:07:25 PM7/2/19
to vim...@googlegroups.com
I noticed that since around 8.1.1561 (or was it 1651?), showcmd would start showing one-off cursor movements (hjklwbe, etc.) in normal mode, very briefly. It's barely noticeable in gvim, more noticeable when sending the keystrokes over a slow connection (eg., remote SSH) — annoying, then, in fact. Yes, I know it is bad form to hold down those keys, but still, I didn't notice Vim doing that before recently.

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?
signature.asc

Tony Mechelynck

unread,
Jul 2, 2019, 9:52:47 PM7/2/19
to vim_use
On Tue, Jul 2, 2019 at 6:07 PM Paul <vim9...@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".)

Best regards,
Tony.

Paul

unread,
Jul 3, 2019, 6:47:13 AM7/3/19
to vim_use
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'`.
signature.asc

Marius Gedminas

unread,
Jul 3, 2019, 9:20:05 AM7/3/19
to vim_use
On Wed, Jul 03, 2019 at 11:47:03AM +0100, Paul wrote:
> 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'`.

But it is! :help 'showcmd' says

(Vim default: on, off for Unix,
Vi default: off, set in defaults.vim)

So if you skip defaults.vim, and you're running vim on Unix, it'll be off.

Regards,
Marius Gedminas
--
"Don't trust a statistic you haven't faked yourself."
-- Seen in another posting by Markus Kuhn
signature.asc

Paul

unread,
Jul 25, 2019, 7:39:08 AM7/25/19
to vim...@googlegroups.com
On Tue, Jul 02, 2019 at 05:07:19PM +0100, Paul wrote:
>I noticed that since around 8.1.1561 (or was it 1651?), showcmd would start showing one-off cursor movements (hjklwbe, etc.) in normal mode, very briefly. It's barely noticeable in gvim, more noticeable when sending the keystrokes over a slow connection (eg., remote SSH) — annoying, then, in fact. Yes, I know it is bad form to hold down those keys, but still, I didn't notice Vim doing that before recently.

Any idea about this? It's still happening as of patch 1746. On a remote, slow connection (for visibility), where file is something that Vim has a syntax definition for (again, for visibility), and large enough to scroll up and down for a few moments:

vim -Nu NONE -c 'set showcmd' -c 'syntax on' file

Hold j or k down long enough that Vim has to scroll the file (not just move the cursor). For me, "j"/"k" flickers in the showcmd area.
signature.asc
Reply all
Reply to author
Forward
0 new messages