Fabien Meghazi wrote:
I uses screen under rxvt-unicode, in my .vimrc, I map the Shift-Up key
combination like this:
noremap ^[[a zc
As soon as I'm under screen it doesn't work anymore.

Found the reason why my keymapping doesn't work with vim under screen.
I guess vim interprets the escape sequence differently according to
the TERM's environment variable and in my case it's "screen".
If I do export TERM=rxvt under screen then the key binding is ok with vim

What makes vim reacting differently between TERM=rxvt and TERM=screen ?
Is there a way to make things work properly or should I export
TERM=rxvt each time I run screen  ?


Different terminals may represent the same key differently. If using

        :noremap    <S-Up>    zc

(with <S-Up>, not <Esc>[a ) doesn't work, then it could that mean your termcap is broken, or that your $TERM is not properly set.

If _all_ keys are recognised properly if you set $TERM to 'rxvt' under screen then a possibility would be

        if &term == "screen"
                set term=rxvt
        endif

unless there are other consoles, with other termcaps, which can be used through screen, in which case you must make sure that screen does not set $TERM to 'screen' regardless of what actual console it runs in, but instead leaves that variable set at whatever it was set before.


Best regards,
Tony.

Reply via email to