Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Ctrl-Left and Ctrl-Right bound for vim, and would like to be able to use these shortcuts when vim runs inside screen.

However, because of Screen's input translation my key presses are mangled and vim does the wrong thing.

Trying to disable the key bindings with bindkey kr or bindkey -k kr while under screen does not work.

How do I keep my vim shortcuts while running it under screen?

share|improve this question
up vote 3 down vote accepted

You need to set the $TERM variable to something that supports those keys. By default screen sets it to 'screen'. I have found setting it to 'xterm' does the trick. To achieve this you have two options.

Start screen like this: screen -T xterm, or put the following in your .screenrc.

term    xterm
share|improve this answer
Thankyou suvayu, that did the trick! – brice Oct 28 '11 at 15:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .