macvim
macvim copied to clipboard
macmeta interferes with Swedish keyboard
If I start macvim:
mvim -u NONE
and do
:set nocp
:set macmeta
:inoremap <M-e> foo
Then, pressing either å
or Alt+e
in insert mode will insert foo
. Both are treated as the same key. Is there any way to allow them to have separate mappings?
The short answer is no. I assume you are using the GUI version of MacVim instead of just in the terminal? (Edit: yes you are, since you are calling mvim
)
GVim basically treats <M-e>
as the same as the character 'e' with the high bit set, which is the same as å
, hence it has trouble determining between the two. When you set macmeta
, MacVim basically behaves the same way, so there's no way to differentiate the two easily.
I do agree this is kind of silly as it's sort of just holdover from Vim's terminal roots even when you are running it in GUI mode. I would need to think a little about how to fix this. Ideally, <M-e>
just gets triggered when you hit Alt-E, and å
only when you hit that character.
@segeljakt Additionally to @ychin said, you can turn on keyboard preview on any OS you want and look how the modifiers work.
in macOS both alts modifies keys before they went to MacVim.
In Windows only right alt key modifies keys, as many apps using Alt+