[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vim keybindings not working in screen

From: Johan Svedberg
Subject: Re: Vim keybindings not working in screen
Date: Thu, 31 Jan 2008 21:25:22 +0100

On Jan 31, 2008 1:30 PM, Alain Bench <address@hidden> wrote:
> Hello Johan,
>  On Saturday, January 26, 2008 at 15:31:14 +0100, Johan Svedberg wrote:
> > keybindings in vim using Ctrl and Meta with the Left and Right arrow
> > keys [...] works fine outside of screen but not from within.
>     Those key combinations are not very portable across terminals. They
> are not part of the Screen virtual terminal. So Screen doesn't do
> anything special with them, and generic TERM=screen* entries do not
> report them (and should not). However Screen lets those keys pass thru,
> from real terminal to apps, unmodified. This permits a proper solution:
> Create a custom specialized terminfo entry, for Screen inside Xterm.
> Such entries give you more out of your terminal, but are less portable:
> I mean, if you detach and reattach Screen to another terminal, it might
> well break. For a start:
> | # specialized entry for Screen when started in an Xterm
> | # adds support for ctrl-alt-left and right arrows
> | screen.xterm|xterm-sc|GNU Screen inside Xterm,
> |       kLFT5=\E[1;5D, kRIT5=\E[1;5C,
> |       kLFT3=\E[1;3D, kRIT3=\E[1;3C,
> |       kLFT7=\E[1;7D, kRIT7=\E[1;7C,
> |       use=screen,
>     "tic -x" this file, and export TERM=screen.xterm (if TERM=xterm
> before you start Screen, this should be automatic).
>     There may still remain a Vim-specific problem: IIRC Vim accepts to
> properly interpret those keys only when TERM begins by "xterm". My entry
> above defines an "xterm-sc" alias, just for this: When under screen,
> alias vim to "vim -T xterm-sc", and it should work.
> | $ case $TERM in screen*) alias vim='TERM=xterm-sc vim';; esac
> | $ vim

Hi, Alain

Thanks alot for your great answer! It works like a charm now. Plus, I
ended up learning some new things about these kind of things at the
same time. I bow to your knowledge! :-)


Johan Svedberg, address@hidden,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]