batbrat
batbrat

Reputation: 5241

How to debug and fix a failure of <C-]> to jump to a tag in vim over PuTTY, even though :tag <tagname> works?

I recently generated tags for my project using Exuberant Ctags following approach 4 at: http://ctags.sourceforge.net/faq.html#15.

After this, I have been able to use the tags, tag and stags command to jump to tags. However, Ctrl + ] i.e. <C-]> does not jump to a tag when pressed.

I read through some similar questions and found that the following might be relevant:

:verbose setlocal iskeyword?
  iskeyword=@,48-57,_,192-255,#
        Last set from /usr/share/vim/vim74/ftplugin/vim.vim

And

:map <C-]>
No mapping found

My Ctrl and ] keys are working fine. I'm able to type the square brace, and I'm also able to use commands like Ctrl + W h/j/k/l to switch between vim splits.

I have checked inside and outside of screen, and checked my .vimrc and .bashrc as well. My .vimrc is at: http://pastebin.com/GkF416SY

Unfortunately, I remain clueless as to whether Ctrl + ] is getting eaten by some program (PuTTY/bash?) or if there is some other issue. I would really appreciate help in fixing this issue. I'd be happy to provide any further information.

EDIT: I'm using a COLEMAK layout with an ordinary keyboard. The [ key is immediately to the left of Enter.

EDIT 2:

EDIT 3: Following @gregory's advice, remapping to worked. Interestingly enough, mapping to and pressing Alt + ] doesn't work!

Oddly, Alt + \, Alt + / also don't work while remapping. One side's Alt key is sending in the character directly, so I'm forced to use Right Alt.

EDIT 4: I found the following in the list of mapped keys:

o  [%          * v:<C-U>call <SNR>13_MultiMatch("bW", "o") <CR>
v  [%            <Esc>[%m'gv``
n  [%          * :<C-U>call <SNR>13_MultiMatch("bW", "n") <CR>
o  ]%          * v:<C-U>call <SNR>13_MultiMatch("W",  "o") <CR>
v  ]%            <Esc>]%m'gv``
n  ]%          * :<C-U>call <SNR>13_MultiMatch("W",  "n") <CR>

I'm not sure, but this may be the cause of the problem. Could you please explain the use of the '%' character here? I took a quick look, but I haven't been able to track it down yet.

Upvotes: 1

Views: 616

Answers (1)

Luc Hermitte
Luc Hermitte

Reputation: 32986

On my French AZERTY keyboard, if want want to hit CTRL+], I have to remember where it's placed on a US/QWERTY keyboard. Then, I hit CTRL + this key.

IOW, as I never remember where those keys are depending on the keyboard used, I've mapped CTRL+] to something I can remember: <M-Down>.

Upvotes: 1

Related Questions