4

Context:

set encoding=utf-8

If I type:

:imap <M-h> foo

then I type

:imap <M-h>

I get:

i è foo

and, as result, both <M-h> and è, if pressed in insert mode, insert foo

I tested this behavior both on Ubuntu 12.04 and Windows XP

Linking to this question, seems that GVim treats the Meta key adding 0x80 to the keycode.
Reading the previous linked answer and googleing I thought it might be only a matter for terminal Vim, not for GVim.

Any suggestion?

Community
  • 1
  • 1
Irr
  • 656
  • 1
  • 9
  • 19

1 Answers1

4

Due to the way that the keyboard input is handled internally, this unfortunately isn't possible today, even in GVIM. Even worse, some key combinations, like Ctrl + non-alphabetic cannot be mapped, and Ctrl + letter vs. Ctrl + Shift + letter cannot be distinguished.

Some people (foremost Paul LeoNerd Evans) want to fix that (even for console Vim in terminals that support this), and have floated various proposals.

But as of today, no patches or volunteers have yet come forward, though many have expressed a desire to have this in a future Vim 8 major release.

jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252
Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324