2

I have a windows 7 machine with an azerty keyboard running gVim 7.4

My problem is that <C-]> simply does nothing: When I'm in an help page I can't follow the tags links. As I have an azerty keyboard I have to use the keys Ctrl+AltGr+] I thought that was causing the problem but when I use Vim on a distant machine via ssh in a cygwin console <C-]> works properly.

Edit: It also works correctly when I use a local vim instance in a cygwin console. So it seems to be a gVim issue.

I found a question mentionning this problem but none of the answers works for me.

Also I used :verbose nmap <C-]> to check if a mapping was already present but I gave me no mapping found.

What can I do to have this key combinaison working properly?

  • Try the $ key in place of ]: <C-$>. – romainl Jun 23 '15 at 10:20
  • If you're using Windows, it's possible the <C-]> is not defined in the keyboard layout i.e. it doesn't generate a code for Vim to pick up. You can probably change the keyboard layout using MS keyboard layout creator tool, in order to add the missing code(s), but I didn't try that, just read about it some time ago. Or, you can map <C-]> to another combo. – VanLaser Jun 23 '15 at 10:24
  • @romainl: This alternative key sequence works thanks! @ Laser: as the solution of romainl worked I'll probably will not take time to redefine my layout but I have a question: If windows doesn't send a code for this combo, how can it work on a cygwin console? – statox Jun 23 '15 at 10:34
  • It's Vim's fault: ] is hardcoded to the last key on the first alphabetical row. – romainl Jun 23 '15 at 10:43
  • According to a recent discussion on vim_use, langmap might help. – lcd047 Jun 23 '15 at 11:11
1

As it was asked in the comment I'll leave here what I have done so far:

I'm using the solution suggested by @romainl in the comments which is using <C-$> instead of <C-]>. That might not be the most elegant way but it works and I haven't found any drawback for the moment.

I think it is important to also mention @lcd047's suggestion of using the option langmap. From what I understood this option allows to map a character to another. For example I tried to put this set langmap+=]$ in my vimrc to let vim replace ] with $ but I haven't been able to make this solution work I will update this answer if I manage to make the second solution work or if I find a better way.

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.