Mapping control keys in GVim without <c-> and i_ctrl_v
Asked Answered
C

1

7

I've got a problem that I've already solved on the X-server level (BTW: I'm running Ubuntu 12.04) but not in GVim.

I have a German keyboard layout with the letters ö and ä where [ and ] are on a qwerty keyboard. But now I want to change vim's normal mode mappings so I can type ö and Ctrl+ö as if it were [ and CTRL+[, respectively. So I created an xmodmap file and mapped Ctrl+ö to CTRL+[. Now the xserver exhibits the right response (e.g. when I map Ctrl+ö to Ctrl+u I can erase the current line in xterm).

But somehow this doesn't work in gVim, and as far as I understand the gVim help it handles escape sequences like Ctrl+something in a special way (e.g. Ctrl+ö in insert mode yields a plain ö in contrast to the behavior in xterm). But I don't understand how to solve this. Can anyone help me?

EDIT:

I've noticed that it does work when I run Vim in my terminal emulator (which is guake), but not in GVim (which I want to get working).

Carolann answered 21/8, 2012 at 17:26 Comment(3)
Yes, GVim doesn't make the difference between <C-ö> and ö (same with é and others on my french keyboard). Do you want something weird? MacVim doesn't care where ] is physically located: <C-$> is the same as <C-]>.Barvick
Does "without <c-> and i_ctrl_v" in your title mean you don't want solutions that use Vim's :map command? (You don't want vim to know that you've done anything.)Encomiastic
What happens when you do <C-v><C-ö> and <C-v><C-[> in Gvim? Does it output the same character code? How does this result compare to when you do the same thing in Vim?Unlike
O
1

If I understand you correctly try to use the langmap option like this:

:set langmap=ö[,ä]
Ohara answered 28/5, 2013 at 15:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.