I have an annoying issue with the Ctrl+] key combination in Vim on my Macbook. I have a Scandinavian keyboard, so I do not have a ] key. Normally I make a ] character by Alt+9. This is an issue when I use ctags for example, as there is no simple way to jump around in files. I tried to use map <C-9> <C-]>
in my .vimrc, but this does not seem to work. I did get it to work with <C-K>
, but I would much rather prefer <C-9>
(or maybe <D-9>
- that is: Apple command key+9). How can I fix this?
-
See this SO question: stackoverflow.com/questions/6932702/…– eckesAug 31, 2011 at 8:07
3 Answers
Search google for an american qwerty keyboard diagram then compare it with your actual keyboard. The key located at the same spot on your keyboard will work.
On a french keyboard, $ is at exactly the same place as ] so I must type <C-$>
instead of <C-]>
.
In your case, it's probably ^¨~
-
+1 I can confirm that this way works for a (german) QUERTZ keyboard: stackoverflow.com/questions/6932702/…– eckesAug 31, 2011 at 9:50
Try this:
map <C-\> :exec("tag ".expand("<cword>"))<CR>
Of course, replace <C-\>
with whatever combination you'd like.
Closest I've been able to get is with Ctrl Numpad 9:
nnoremap <C-k9> i
From what I can tell the regular number keys are not available for mapping.
The function keys work just fine though, e.g. Ctrl F9:
nnoremap <C-F9> i