gVim doesn't recognize the Meta (Alt) Key in an imap after changing the encoding

Posted by René Nyffenegger on Stack Overflow See other posts from Stack Overflow or by René Nyffenegger
Published on 2010-03-13T10:38:35Z Indexed on 2010/03/13 10:45 UTC
Read the original article Hit count: 566

Filed under:

In order to edit html files, I have the following three imaps in a file that I source for filetype html:

imap <buffer> <M-[> &uuml;
imap <buffer> <M-;> &ouml;
imap <buffer> <M-'> &auml;

This works fine until I change the encoding of the html file with set enc=utf-8. Now, pressing Alt-[ for example gives me a Û.

Interestingly, after sourcing the same file again, it expands the imaps correctly.

This doesn't really make sense to me. So, why is this and how can I have a more constistent environment regarding imap and utf-8.

This is occuring with gVim 7.1 for Windows.

© Stack Overflow or respective owner

Related posts about gvim