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

GNU screen seems to catch the Shift-Tab key combination which is mighty unfortunate as i'm using this combination in vim. Has anyone noticed such behaviour? How can i change it?

share|improve this question
Perhaps you should show your ~/.screenrc and ~/.vimrc. – Dennis Williamson Oct 4 '10 at 21:00
What happens when you press Ctrl+V Shift+Tab in insert mode 1: outside and 2: inside screen? – Gilles Oct 4 '10 at 22:23
@Gilles: i get ^[[Z] in both cases, to be more specific, it's the minibufexpl vim plugin that doesn't seem to react to the Shift-tab within screen the way it does when i'm not running screen (the key combination moves the cursor to the previous buffer label) – Julius Oct 5 '10 at 13:59
@Dennis: i removed both of them (and my .vim folder, except .vim/plugin/minibufexpl.vim) to isolate the issue – Julius Oct 5 '10 at 14:05
up vote 1 down vote accepted

Add this line to your ~/.vimrc file:

set t_kB=^[[Z

To insert the ^[ (escape character) press Ctrl-v then Esc (don't type literal carat-leftbracket).

It's already set in the terminfo file for xterm, but not in the ones for screen.

Alternatively, you can simply set TERM=xterm in the shell.

You can try these at a shell prompt to see the difference:

infocmp -I xterm | grep cbt
infocmp -I screen | grep cbt

The terminfo capabilities cbt and kcbt correspond to the termcap capabilities bt and kB respectively.

share|improve this answer
I have also found this vim wiki link useful ( for fixing the home/end/del keys – Julius Oct 8 '10 at 6:19

You must log in to answer this question.

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