0

Each time Vim (v8.2) starts, it shows a subset of my key bindings, and awaits a keypress, like this:

n  <Space>     * za
n  ,<Space>    * :nohlsearch<CR>
n  Q           * <Nop>
Press ENTER or type command to continue"

In GVim on Windows 10, it shows a tiny dialog window with such a message that must be clicked away before the main window opens.

While searching for the cause of the problem, I read that my .vimrc might have a syntax error or that bindings are overwritten by other modules and vim warns about it, but I was never able to pinpoint the source. Using MacVim, no such messages occur when using the same .vimrc.

What is causing these messages?

mwil.me
  • 101
  • 1

1 Answers1

0

I should have kept looking in the vimrc, the error was caused by the following line:

nnoremap | ,

That should have probably been a different key ...

mwil.me
  • 101
  • 1
  • 1
    You might have to use <bar> if you really want | in a mapping anywhere – D. Ben Knoble Feb 28 '21 at 17:38
  • 1
    This will run the :nnoremap command and then :, since | is used to separate commands, like ; in the shell and many programming languages. nnoremap without arguments will print all mappings (resulting in the ENTER prompt). As mentioned, you should use <Bar> in mappings if you want to map it. See :help map-bar. – Martin Tournoij Feb 28 '21 at 23:57