Le mardi 18 mars 2014 19:57:58 UTC+1, Bram Moolenaar a écrit :
> 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.

Why not? vim do not know what users may want to do or what their keyboards 
looks like.


> > 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.
> 
> 

Yes, exactly. I would like to use something that as symbolic as the 
termcap/terminfo names. Not the escape sequence.

For the names, I may suggest <Previous> or <Prev> and <Next>.
But although <t_%8> is awkward, it is still more terminal-independant than 
mapping directly ^[[5~ to something else. And anything that work is better than 
nothing.

> 
> 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.
> 

Does vim really has to know what is the "previous key"? The terminal generated 
that escape sequence because it thought this was the right thing to do given 
its inputs. I don't think it's vim's concern to know why it has been generated 
or what it is supposed to mean. Just like the F* function keys.


> > > 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.
> 

I agree that the fundamental problems are that termcap/terminfo files are 
buggy/incomplete and that, in my particular case, the "shifted previous-page" 
isn't supposed to exists. However, something that works in practice is still 
better than something that don't.


Celelibi

-- 
-- 
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