Le dimanche 16 mars 2014 15:09:38 UTC+1, Bram Moolenaar a écrit : > Celelibi wrote: > > > > > > What makes you think that %e and %c are the shifted next/previous page > > > > keys? The termcap manpage says: > > > > > > > > kN Key for next page > > > > kP Key for previous page > > > > > > > > %c shifted next key > > > > %e shifted previous key > > > > > > > > "next key" and "next page" are different. Perhaps it's just a > > > > coincidence that %c and %e contain the codes? Officially there are no > > > > entries for the shifted next/previous page keys. > > > > > > Yes, you're right. But I don't think it's a coincidence that xterm > > > produce ^[[5~ for Prior or KP_Prior and ^[[5;2~ for Shift+KP_Prior. I > > > think xterm just do the most sensful thing it can. Since there is no > > > termcap for "shifted previous-page" it send "shifted previous" with an > > > escape sequence that is nothing else than the escape sequence for > > > "previous-page" with shift modifier. > > > > > > - Maybe what I should ask is that vim treat the "previous" key as an > > > equivalent of "previous-page"? Or at least a way to tell vim that I > > > want them equivalent whatever the modifiers it may encounter. > > > - Or maybe that it loads ALL the termcap in the t_* options? And that it > > search for a termcap that match the FULL escape sequence before trying to > > parse the modifiers and search for the modifier-less version? > > > > > > What I mean for the second suggestion is that when I :set t_%e=^[[5;2~ > > > then <C-K>^[[5;2~ make vim print <S-t_%8>. While %e is in the > > > termcap/terminfo file. > > > > > > > > > What really happen is not really clear in my head. Neither is the > > > design of vim. I'm therefore a bit confused about the right way to go. > > > > 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. 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>. > 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. So this "modifier pattern matching" is how vim makes <S-PageUp> work for xterm? And thanks for the time you take for me. ^^ 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 vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.