Petr Mikulik wrote:
since a long time, I've used Alt-hotkeys in both normal and insert mode.
After an upgrade to OpenSUSE 10.2, the Alt-hotkeys stopped working in insert
mode (imap), while they still work in the normal mode (nmap). For example,

:imap <c-i> hello
:imap <a-i> hello
:imap <m-i> hello

=> then in insert mode it is the only Ctrl-I which writes hello, while Alt-I
writes only i. The same in SUSE 10.0 (and older) works OK. I have even tried
to compile vim 6.4 and 7.0 from sources, tried gvim under KDE and BlackBox,
tried different "winaltkeys" etc, ... but no success.
I think it's not a Vim problem.

I see that in openSUSE 10.2 the X server program is named Xorg (not just X as
in e.g. Novell-SUSE 9.3). Were there other changes in the X setup? I don't
know. It it possible to tweak the keyboard interface so that (in cooked input
mode) Vim will get the proper Alt/Meta keycodes? I don't know.

OpenSUSE 10.2 uses packages xorg-x11-7.2-*.

However, vim is getting the proper Alt/Meta keycodes, because the same hotkey works in normal mode, but it is ignored when gvim is in insert mode.

How this can be related to X?
Doesn't some gvim property propagate back to X making the misunderstanding?

It is related to X because gvim, like all programs displaying over the X desktop, gets its keyboard input from X as well as displaying its screen output through X.

The same keys do _not_ work in Normal mode in gvim: after

        :noremap <M-i> :echo 'Meta-i'

hitting Alt-i switches to Insert mode, showing that gvim has received a plain i; the mapping is not executed.

In gvim, hitting Alt-i in Insert mode (preceded or not by Ctrl-V) inserts i (again, a plain i has been received).

In Console vim in /dev/tty (which bypasses X and can run even when the X server is not running), the result is different: there, in Insert mode, hitting Ctrl-V followed by Alt-i inserts ^[i with the ^[ in blue: this means that Vim has received Esc i -- and there, a mapping with <Esc>i as its {lhs} will be executed when you hit Alt-i.

(To switch from the X console to a non-X console, hit Ctrl-Alt-Fn with n in the range [1..6]; each of the 6 text consoles requires a distinct login. To go back, hit Alt-F7 or Ctrl-Alt-F7.)


You may try to start YaST then the "Hardware => Keyboard layout" module; I'm
not sure how to set it up though.

I have tried different "setxkbmap" instead, no success.

---
P.M.





Best regards,
Tony.
--
"It's a summons."
"What's a summons?"
"It means summon's in trouble."
                -- Rocky and Bullwinkle

Reply via email to