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
I used the blog and wiki posts from @nfm's answer and solved it:
Put this in your .Xresources file (you can copy-paste in this case):
xterm*VT100.Translations: #override \
Ctrl ~Shift Tab: string(0x1b) string("[27;5;9~") \n\
Ctrl Shift Tab: string(0x1b) string("[27;6;9~")
Then do cd ; xrdb .Xresources and restart xterm.
Put this in your .vimrc:
!! Important - instead of XXXX you must type CTRL-V and then Esc OR copy-paste the whole text and run %s/\(set which is copy-pastable (insert it with ).
set timeout timeoutlen=1000 ttimeoutlen=100
set =XXXX[27;5;9~
nnoremap gt
set =XXXX[27;6;9~
nnoremap gT
And restart vim.
Done.