Vimr: ctrl-6 not working

Created on 26 Jul 2017  路  6Comments  路  Source: qvacua/vimr

Toggling between recent buffers with ctrl-6 does not work in vimr.
However, ctrl-^ (that is, shift ctrl 6) does work..
Please see :h ctrl-6

Thanks!

Most helpful comment

Hi.

It seems vim previously mapped <C-6> to 0x1E aka ^^ aka <C-^>, however now neovim gave <C-6> its own mapping.

  • You can recover previous vim functionality by adding to nnoremap <C-6> <C-^> init.vim.

About <C--> and 0x1F aka ^_, something similar have happened:
Vim seems to conflate ^_ <C--> <C-S--> <C-_> and <C-S-_> while neovim considers them different mappings. (Except for entering ^_ which seems to have Vim's behavior)

  • You can make tcomment work again by typing this in init.vim: nmap <C--> <C-_>
  • If you want something closer to what vim does you can try: nmap <C--> ^_
    Note: You will need to use digraphs for typing ^_ in VimR (by typing <C-k><S-u><S-s> in sequence)

I'm not sure if this is something VimR should fix by itself, but I did a little branch which is a bit more similar to what vim does here

All 6 comments

I also have that. In my setup, I use tcomment.vim and the mapping for <C--> is also broken in VimR.

Hi.

It seems vim previously mapped <C-6> to 0x1E aka ^^ aka <C-^>, however now neovim gave <C-6> its own mapping.

  • You can recover previous vim functionality by adding to nnoremap <C-6> <C-^> init.vim.

About <C--> and 0x1F aka ^_, something similar have happened:
Vim seems to conflate ^_ <C--> <C-S--> <C-_> and <C-S-_> while neovim considers them different mappings. (Except for entering ^_ which seems to have Vim's behavior)

  • You can make tcomment work again by typing this in init.vim: nmap <C--> <C-_>
  • If you want something closer to what vim does you can try: nmap <C--> ^_
    Note: You will need to use digraphs for typing ^_ in VimR (by typing <C-k><S-u><S-s> in sequence)

I'm not sure if this is something VimR should fix by itself, but I did a little branch which is a bit more similar to what vim does here

Thanks! That's one great explanation! I will be sure to incorporate those fixes in my config. One thing of note, though, is that NeoVim running in the console has correct mappings for both <c-6> and <c--> for me.

BTW, how can I detect that I'm running VimR?

Right. AFAIK, terminal emulators capture key combinations and send their corresponding control codes.
(At least, this xterm documentation mentions it, you can search for CTRL-_ there)

Also VimR sets its own has("gui_vimr") flag!

It did fix <c-6> for me. As far as tcomment goes, I switched over to using gc{motion}.

@nhtzr Ctrl-6 seems to be quite popular :) I think it'd be nice if we include your branch in develop.

PS. BTW you can now push your branches directly to https://github.com/qvacua/vimr. This way it's much easier to try out and review your branches in the IDE. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hakamadare picture hakamadare  路  4Comments

romaninsh picture romaninsh  路  7Comments

0ax1 picture 0ax1  路  8Comments

robertgzr picture robertgzr  路  7Comments

TravisDart picture TravisDart  路  7Comments