I want to map ctrl-tab to :tabn, and ctrl-shift-tab to :tabp.
I had it working for gVim in Windows XP, but moved it to my .vimrc in Ubuntu 9.10 and it doesn't work (vim 7.2).
Here's the relevant section of my .vimrc:
nmap <C-Tab> :tabn<CR>
nmap <C-S-Tab> :tabp<CR>
nmap <C-t> :tabnew<CR>
<C-t>
works fine, so mapping the ctrl key doesn't seem to be a problem. I really have no idea where to start! What could be going wrong here, considering it worked fine under Windows?
More info: I'm running Ubuntu 9.10 server, with xorg
and fluxbox
installed on top. I'm using xterm
as my terminal.
Ctrl-tab mapping works in fluxbox: I can map ctrl-tab and ctrl-shift-tab successfully in my window manager; if I start tabbing my xterms, I can cycle through those tabs as expected. I'm not sure what this means, but I think the issue is not a window manager/xorg issue.
The keys don't seem to be mapped to something else, and can be recognised together successfully.
Answer: It's an xterm
issue - it doesn't intercept and send a unique keycode for ctrl-tab
. See my full answer below for details.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…