0

I am using Neovim on Windows using Cmder console emulator. I find that using [NUM]<Ctrl-6> to change to buffer [NUM] does not work on Windows. Following discussions here. I have set up a mapping:

nnoremp <C-6> <C-^>

But I still can not switch buffers using Ctrl-6. Any ideas what is wrong?

Edit: After going through the post here. I find that <C-6> is correctly mapped to <C-^>. So the reason may be that some application intercept <C-6> before vim can receive it. But it is hard to find the real cause.

  • 1
    Something I wrote to help you debug that and give us more relevant information (Assuming that you made a typo in your question and don't actually use nnoremp) – statox Nov 19 '18 at 13:27
  • Thanks, I will try to debug more and edit my question later. – jdhao Nov 19 '18 at 13:36
  • Have you tried <C-^> at all? – D. Ben Knoble Nov 19 '18 at 20:16
  • @D.BenKnoble Yes, I have tried <C-^> and it works. – jdhao Nov 20 '18 at 1:39
1

Perhaps Ctrl-6 is not recognized.

Open (neo)vim and go into insert mode. Then enter Ctrl-V followed by Ctrl-6. See what it prints. For me on Ubuntu (GNOME-Terminal) this prints ^^. So here Ctrl-6 is Ctrl-^.

See what it prints for you, then you are able to fix your mapping.


In the way described above, you can check if a control-key is mappable.

To check if Ctrl-X is mappable, you go to insert mode and hit Ctrl-V followed by Ctrl-X. This prints ^X (this is one character). So Ctrl-X is mappable.

Now we would like to map Ctrl-#: Again Ctrl-V followed by Ctrl-#. This just prints #. So Ctrl-# is not mappable, as it is identical to #. (Tested with GNOME-Terminal.)

Some keys might already be used as shortcut by the terminal. In that case the terminal consumes the key and does not send it to Vim. If this is the case, check if you can reconfigure shortcuts.

Note that the terminal is in control here. (Neo)Vim only get those keys, that the terminal sends to it.

Also note that gVim has more capabilities. E.g. gVim is able to distinguish between Home and kHome (NumPad). Vim in GNOME-terminal is not.

  • It does not print anything. – jdhao Jan 10 at 13:55
  • @jdhao See my update. – Ralf Jan 10 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.