On Mon, 09 Jun 2008 17:41:00 +0200
Bram Moolenaar <[EMAIL PROTECTED]> wrote:

> > In that case, I'd like to hear your suggestion on how I may use
> > combinations of Shift/Ctrl/Alt with keypresses in a normal vim.
> 
> Nothing special, most of them can be recognized already.  Especially if
> you are using an xterm.  Try ":set term=xterm" and then ":set termcap".
> The entries which contain ";*" recognize modifier keys.  For other
> terminals you will need to add the termcap entries somehow.

Yes; that works on real vim-in-xterm. But what of e.g. screen? When I'm
editing an email in mutt, running via screen, this uses vim. vim starts
up with $TERM=screen, not xterm, so doesn't know to do that.

Perhaps to handle this case, vim ought always to recognise the ;* entries?

> > Currently, the only way I find that works at all is to keep a giant list
> > of :map and :map! commands, which recognise the sequences. See the
> > attached file.
> > 
> > This sortof works; it's enough to get things like Ctrl-LR to be move word
> > left/right, Alt+arrow to be move focus to window, and Alt+[number] to
> > be :b1 to :b10.
> > 
> > It doesn't work in paste mode, and it upsets the ttytime settings.
> > 
> > Also, it breaks UTF-8 input if I try to map Alt+letter.
> 
> Alt-letter is supposed to work to get the letter with the 8th bit set.
> Then converted to whatever encoding you are using.  This is how vi
> traditionally works, in combination with traditional terminals (and
> terminal emulators).
> 
> Also note that things like <Esc>0 should never be produced by a single
> key, since it should mean <Esc> (leave Insert mode), and zero (go to
> first column).  Relying on timing is not a good idea.

I'm aware of the problems with timing :)

Seems we're stuck though, ultimately.. we can't make all three of
<Esc>letter, <Alt-letter> and UTF-8 work.

> > If you know of a better way to make all these things possible, I would
> > very much like to hear it.
> 
> It appears you need to read  :help xterm-modifier-keys

Again, I'm aware of it. I'm aware that it doesn't apply during screen.

How would you recommend I make vim-in-screen work, then? Just set
TERM=xterm or some vim-specific fiddling if it notices $TERM == screen ?


I still think ultimately a rethink of the bottom input layer is best
here... I can make it not break anything that currently works... Read
terminfo just as before - it'll still JustWork on your 1970s glass
teletype that sends Weird Sequences. It'll just happen to work better on
a modern xterm. And as a side-effect, GDK and other input layers will
work better.

I'm still failing to understand your hostility toward it.

-- 
Paul "LeoNerd" Evans

[EMAIL PROTECTED]
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Attachment: signature.asc
Description: PGP signature

Raspunde prin e-mail lui