Simon Jackson wrote:
the following entries in my vimrc only work in gvim but will not work
in eterm, aterm or xterm:

nmap <C-S-tab> :tabprevious<cr>
nmap <C-tab> :tabnext<cr>
map <C-S-tab> :tabprevious<cr>
map <C-tab> :tabnext<cr>
imap <C-S-tab> <ESC>:tabprevious<cr>i
imap <C-tab> <ESC>:tabnext<cr>i

anyone know why?


Open Console Vim with an empty [No Name] buffer, hit i or a to start Insert mode, then hit Ctrl-K followed by one of the keys in the {lhs} of your mappings. The keyname should appear in <> notation. If it doesn't, hit Ctrl-V followed by the same key. You should see the bytestring sent by the keyboard interface appear in the buffer. If nothing appears, it means that key press doesn't reach Vim. For instance, in my kde window manager, Ctrl-Tab and Ctrl-Shift-Tab are intercepted by the window manager to mean "go to next/previous virtual desktop"; they never reach xterm or even gvim. If something appears, you can compare that with the codes displayed by ":set termcap".

If the termcap/terminfo on your disk is better than the one built into Vim, ":set nottybuiltin" might help you. If it doesn't, you may have to "correct" the termcap by means of commands the vimrc, something like (untested)

        if !has("gui_running")
                if &term == "xterm"
                        exe "set <S-Tab>=\\\e[Z"
                        " etc;
                elseif &term == "eterm"
                        " etc.
                elseif &term == "aterm"
                        " etc.
                endif
        endif

If these keys don't reach console Vim, you will probably have to resign about Ctrl-[Shift-]Tab and use something else instead, maybe F keys such as <F2> and <S-F2>.


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
103. When you find yourself in the "Computer" section of Barnes & Noble
     enjoying yourself.

Reply via email to