Reply to message «Simple mapping accepted, but incorrectly displayed.», sent 12:59:26 14 June 2011, Tuesday by Erik Christiansen:
First, you probably need insert mode mappings. Second, can you answer why you
don't use `nore'? It is a general rule: use `nore' unless you know what you are
doing. Third, you should specify encoding of the file where mappings are.
Fourth, you should be sure that internal vim encoding ('encoding' option) has
requested characters.
So you should write:
" In the vimrc
set encoding=utf-8
" At the very top of any file containing non-ascii characters
scriptencoding utf-8
<...>
inoremap <A-a> å
inoremap <A-e> æ
inoremap <A-o> ø
inoremap <A-<> «
inoremap <A->> »
Note that there are some issues with unicode characters containing 0x80 byte.
If
some of the mappings does not work, try replacing it with
inoremap <expr> <A-C> "\uXXXX"
(where C is actual character and XXXX is a hex code for rhs).
Original message:
> In Vim 7.3, I added the following mappings:
>
> map <A-a> å
> map <A-e> æ
> map <A-o> ø
> map <A-<> «
> map <A->> »
>
> in an effort to make vim a little more Danish-friendly. All the mappings
> are accepted without complaint, but the characters displayed when the
> mappings are invoked are not those mapped. I've tried both with
> fenc=latin1 and fenc=utf-8. In each case, the displayed characters are:
>
> <A-a> á
> <A-e> å
> <A-o> ï
> <A-<> ¬
> <A-<> ®
>
> This post was input with fenc=utf-8, and the mappings set by pasting the
> above map statements into the ex command line.
>
> It would be quite delightful if this could be made to work, but I'm
> struggling to figure out how.
>
> Erik
signature.asc
Description: This is a digitally signed message part.
