Mapping in my vimrc fails in Ubuntu

前端 未结 4 1111
挽巷
挽巷 2020-12-08 04:46

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

4条回答
  •  感动是毒
    2020-12-08 05:36

    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 =\)XXXX/\=submatch(1) . "\33"/g 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.

提交回复
热议问题