Alexey I. Froloff wrote:
* A.J.Mechelynck <antoine.mechelynck@> [061021 08:01]:
IMHO, the way to configure it is not by hacking Vim but (at
least in console Vim) by having a properly-built
termcap/terminfo which tells Vim which codes correspond to
which keys.
IIRC, only user can tell what will Meta+Key send and it has
nothing to do with term*. I'm talking about convert-meta
(inputrc) and eightBitInput (xterm).
As you told me recently, "you don't know what you're talking about". Most
nontechnical users don't know (and don't care) what binary keycodes their
keyboard interface is sending to their program when they hit which key
combination. Only the programmers of the keyboard interface (and the admins
who write keyboard-interface configuration files) can decide which keycodes
correspond to which keypresses, and it takes quite some technical expertise to
find out with certainty what key combinations are sent by which keypresses on
which systems for all possible combinations of modifier and other keys. It
might be relatively straightforward (if not necessarily easy) for programs
running only on Windows or only on X11 but Vim has to cater for not only
Windows, X11 and Carbon but also tens of different text consoles and console
emulators. Vim relies on such things as the termcap/terminfo libraries (both
builtin and disk-resident) and the $TERM environment variable to tell it what
terminal it is running on, which influences how it will interpret the keycodes
sent to it by the keyboard interface. If the termcap is broken or $TERM set to
a wrong value (both of which happen more often than you might think), Vim will
misunderstand what the keyboard sends.
but no program can discriminate between different keypresses
which your keyboard driver translates to the same keycode (or
keycode sequence).
Vim assumes that Meta+Key always generates (Key | 0x80). Code:
[snip]
What I'm saying, is that, if my (fr_BE) keyboard interface is sending the same
keycode when I hit é (SMALL LATIN LETTER E WITH ACUTE ACCENT) and when I hit
Alt-i (SMALL LATIN LETTER I with the Alt modifier), then Vim won't be able to
see the difference between é and Alt-i, and in that case, if I use "imap <M-i>
{rhs}" I'll get that {rhs} instead of an e-acute whenever I hit é in Insert
mode. With such a keyboard interface I should avoid mapping Alt-keys in Insert
mode if I want to be able to type French text: IOW, with that kind of keyboard
interface, é and Alt-i are, как говорят Французы, белый колпак и колпак белый,
или как говорят Англичане, шесть одного и полдюжина другого: /bonnet blanc et
blanc bonnet/, or six of one and half a dozen of the other.
Regards,
Tony.