On 22/08/13 18:24, Paul LeoNerd Evans wrote:
In accordance with terminal standards, my terminal sends modified
Unicode that doesn't have any other representation (such as
Ctrl-Shift-P) using CSI u encoding; for example

   <C-S-P>  ==   CSI 80;5 u

Unfortunately vim doesn't understand this, getting as far as the Escape
part of the CSI, treating it as

   Esc [ 80 ; 5 u

causing vim to leave insert mode, start a [ movement that's then
aborted, then undo the previous 5 changes. Not helpful.

Currently I have something of a bit of a hack in my .vimrc to handle a
few of the more common ones by programatically generating a large list
of map/imap commands; for example, the handler for Space:

    <Esc>[32;8u   <C-S- >
    <Esc>[32;7u   <C- >
    <Esc>[32;6u   <C-S-Space>
    <Esc>[32;5u   <C-Space>
    <Esc>[32;4u   <S- >
    <Esc>[32;3u
    <Esc>[32;2u   <S-Space>

However, I believe we can all agree this is unsustainable, as I don't
want to have to store a map and an imap command 7 times for each of the
~60-odd Unicode keys I could type.

Instead does anyone have a better idea here?


Do you have a proper termcap/terminfo for that terminal? Is $TERM (and 'term') set to a correct value? See also

        :help 'ttybuiltin'
        :help 'esckeys'
        :help 'timeout'
        :help 'ttimeout'
        :help 'timeoutlen'
        :help 'ttimeoutlen'

It seems that the builtin terminals (when compiled with ++builtin_terms, and at least on the Vim 7.4.16 version for Linux I'm using) are

        builtin_amiga
        builtin_beos-ansi
        builtin_ansi
        builtin_pcansi
        builtin_win32
        builtin_vt320
        builtin_vt52
        builtin_xterm
        builtin_iris-ansi
        builtin_debug

plus the builtin_gui used unchangeably for gvim.

The workaround, I suppose, would be using Ctrl-P etc. without the Shift modifier, which would (hopefully) give the ASCII values for the control keys known to ASCII (0x01 for Ctrl-a, 0x02 for Ctrl-b, 0x10 for Ctrl-p, etc.), but of course, for use as a mapping {lhs}, it would collide with many buit-in key bindings (e.g. Ctrl-P is by default synonymous with <Up> or k in Normal mode, so there it isn't a great loss, but in Insert mode Ctrl-N and Ctrl-P mean next/previous completion using 'complete' so you would have to look out if that's a use case you're interested in).

Best regards,
Tony.
--
DON'T go!!  I'm not HOWARD COSELL!!  I know POLISH JOKES ... WAIT!!
Don't go!!  I AM Howard Cosell! ... And I DON'T know Polish jokes!!

--
--
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/groups/opt_out.

Raspunde prin e-mail lui