Celelibi wrote:

> > Since the terminal emulaters do more than what termcap/terminfo support,
> > Vim has some extensions.  See :help xterm-modifier-keys.
> 
> Yes but vim doesn't even fully support what IS in the terminfo.
> I added kPRV=^[[5;2~ in the terminfo file for screen. And vim just
> ignore it. Don't you think this is a surprising behavior? (Without
> even talking about bugs.)
> 
> After reading and testing some stuff, it seems that vim only load the
> termcap it knows about. Don't you think it should load ALL the defined
> termcap codes? I haven't seen a way to do this with the termcap API,
> but the terminfo API has a tables with all the termcap and terminfo
> codes.

No, adding all the codes does not make any sense.

> Al least, may I ask that %e and %c be added into the key_names table
> in term.c? After all, vim already knows about those termcap codes,
> they appear in the modifier_keys_table in misc2.c. And this would
> allow me to easily map <S-t_%8> to <PageUp>.

So, what you would like is to relate termcap/terminfo entries with named
keys.  That means we actually need names for those keys, which we have
to come up with.  Unless we stick to using the t_%3 form, which is
rather awkward and most users have no clue what that means.

And then we have these entries in terminfo that we don't know what they
mean.  What is the "previous key"?  How do users know what to do with
that?  How do termcap/terminfo authors know what to do with it?  This is
not properly standardized, unfortunately.

> > But this only works for the builtin xterm codes out of the box.  You
> > could do this:
> > 
> > if $TERM == "screen"
> >   set t_kP=<1b>[5;*~
> >   set t_kN=<1b>[6;*~
> > endif
> 
> Wow, that's interesting. However, it's still a bit hackish to put an
> escape sequence in my .vimrc while it is already in the terminfo file.

No, it's not hackish at all.  Especially since there are lots of bad
termcap/terminfo files everywhere.

> So this "modifier pattern matching" is how vim makes <S-PageUp> work
> for xterm?

Yep.  It's a generic implementation.


-- 
To keep milk from turning sour: Keep it in the cow.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui