Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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).

like image 241
jan Avatar asked Aug 21 '12 17:08

jan


1 Answers

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

:set langmap=ö[,ä]
like image 197
lollo Avatar answered Oct 02 '22 18:10

lollo