Reputation: 351
In :help tag
it says that one can go to a tag definition using the CTRL-] keystroke. But I can't get this to work. I thought I messed some mappings with my plugins, so I cleaned .vimrc
. But I still get cursor to a tag word (in help for example). I strike Ctrl and ] simultaneously and nothing happens.
How to fix it? Or maybe I'm reading :help
wrong?
Upvotes: 22
Views: 33248
Reputation: 6117
On a Danish keybord on Windows 10 this works:
Ctrl + ¨
¨
is the diuresis or umlaut sign, positioned to the right of 'å'.
Upvotes: 1
Reputation: 1
Same solution for a german qwertz-keyboard -> CTRL-+ did the trick! Thanks!
Upvotes: 0
Reputation: 1
I had this same problem and I solved it. In my case I was maping the key CTRL + F10. So I First hit CTRL + F10 in Vim insert mode and see what the key output is. In my case it was F36
then I simply map it in vimrc file as
map <F36> <CR>YOUR COMMAND<CR>
Upvotes: 0
Reputation: 935
This solution only works for linux in an X environment for non-us keyboard layouts.
I just struggled with this problem in linux with a swiss german keyboard layout. We type ] by pressing AltGr+¨, thus i would have to use AltGr+Ctrl+¨ to jump to the ctag definition, which is awkward.
What i did was to remap the ¨ (diaeresis) key to ] (bracketright)
print current mapping for keycode 35:
$> xmodmap -pke | grep 35
keycode 35 = dead_diaeresis exclam dead_diaeresis exclam bracketright dead_macron bracketright
remap key (we just replace the first dead_diaeresis with bracketright):
$> xmodmap -e 'keycode 35 = bracketright exclam dead_diaeresis exclam bracketright dead_macron bracketright'
Pressing keycode 35 (¨) will now print ] without the need of any modifier, and CTRL-] works to jump to the tag.
xmodmap -e can be executed as user without need for sudo, you can put it for example in your .profile.
see swiss-german layout for reference
Upvotes: 0
Reputation: 276
For mee, "Ctrl-]" means "Ctrl+Alt GR+)". In other words,
Upvotes: 1
Reputation: 1
The problem is due to default setting of Virtual box. In Oracle Virtual Box you can see by default right control is using as Host key combination. Go to File -> Preferences-> Input and change Host key combination to "None". Initially for me also left ctrl worked and after the above changes both keys working.
Upvotes: 0
Reputation: 81
I have the same issue, and :verbose
did not bring up anything useful. What I figured out is that Ctrl-+ takes me there.
Please note that I am using a German keyboard where the plus sign sits at the position of square bracket on a US keyboard. Maybe the code only looks at the location of the key (I remember reading something to that respect in combination with the Ctrl-key).
Upvotes: 8
Reputation: 11
I was facing same problem on virtual box VM. The right ctrl key is to switch between the host and the guest environment. Try using left ctrl + ].
Upvotes: 1
Reputation: 557
First, use the :verbose
command (thanks to sehe) to know who rebound your key where.
:verbose nmap <C-]>
Then, if you cannot find where your key was rebound, bind yourCtrl-] key by the original one then retry:
:nnoremap <C-]> <C-]>
For more info:
:help mapping
:help :verbose
:help :noremap
Upvotes: 21
Reputation: 21
A somewhat late entry, but I had the same problem. Thought I'd share a possible solution so others wont have to go through the agony.
The solution in my case was: Press Ctrl and while keeping it pressed down, press ] twice!!! Whatever key combination you use to produce the right square bracket, ], do it twice!! I do not know why this works in my case. There's nothing in the help files that mentions this. Spent probably an hour or two trying to figure out the Ctrl-] combination until I came upon the solution by accident.
Upvotes: 1