From: "A.J.Mechelynck" <[EMAIL PROTECTED]>
Subject: Re: Mapping german umlauts
Date: Sun, 08 Oct 2006 16:41:22 +0200
> Meino Christian Cramer wrote:
> > Hi,
> >
> > I want to remap the german umlauts to "{","[","]" and "}" in normal
> > mode only.
> >
> > When I type the umlauts on the commandline of my zsh there is no
> > problem.
> >
> > When I type them in insert mode in vim: no problems.
> > Therefore I /think/ (read: dont no for sure) that there should be no
> > problem.
> >
> > In my $HOME/.vimrc I wrote:
> >
> > nnoremap o [
> > nnoremap a ]
> > nnoremap O {
> > nnoremap A }
> >
> > (I replaced the umlauts with their corresponding vowels here in this
> > mail only -- just to make them displayable in any case...)
> >
> > But this does not work. With the :map command I can see the maps but
> > the umlauts looks like 8bit-something. Two of them are displayed as
> > two characters.
> >
> > Then I tried:
> >
> > nnoremap <o> <[>
> > nnoremap <a> <]>
> > nnoremap <O> <{>
> > nnoremap <A> <}>
> >
> > which results in nothing: Now the "corrupted" maps via the :map
> > command has vanished completly.
> >
> > Now I got an Error message displayed in front of my inner eye:
> > "WARNING! Idea stack underflow!"
> >
> > What can I try else ?
> >
> > Thank you very much for any help in advance !
> > Keep hacking!
> > mcc
> >
> >
>
> You should not change 'encoding' after setting your maps; and if your vimrc's
> 'fileencoding' is not your 'encoding' then it ought to have a
> ":scriptencoding" statement.
>
> Or else, you can encode it in 7-bit ASCII using <Char-nn> notation, e.g.
>
> exe "noremap <Char-196> }" | " LATIN CAPITAL A WITH DIAERESIS
> exe "noremap <Char-214> {" | " LATIN CAPITAL O WITH DIAERESIS
> exe "noremap <Char-228> ]" | " LATIN SMALL A WITH DIAERESIS
> exe "noremap <Char-246> [" | " LATIN SMALL O WITH DIAERESIS
>
> The above should work regardless of whether your 'encoding' is Latin1, UTF-8,
> or (I think) cp1252; but if you use an 'encoding' different from your
> "locale"
> charset, you should still set 'encoding' first and define the mappings
> afterwards. (I use ":exe" wrapping here to allow a comment on the same line.)
>
> Similarly:
> Ä 196 0xC4 LATIN CAPITAL A WITH DIAERESIS
> Ö 214 0xD6 LATIN CAPITAL O WITH DIAERESIS
> Ü 220 0xDC LATIN CAPITAL U WITH DIAERESIS
> ß 223 0xDF LATIN SMALL LETTER SHARP S
> ä 228 0xE4 LATIN SMALL A WITH DIAERESIS
> ö 246 0xF6 LATIN SMALL O WITH DIAERESIS
> ü 252 0xFC LATIN SMALL U WITH DIAERESIS
>
> see
> :help <Char>
> :help :scriptencoding
> http://www.unicode.org/charts/PDF/U0080.pdf
> etc.
>
>
> Best regards,
> Tony.
>
Hi Tony,
:)
What should I say? "Thank you so much for your kind help, Tony!"
becomes a little boring to you in the meanwhile I think, doesn't it?
:O)
Probably it is a good idea starting to collect the "Tony Files" or an
AI-help-feature for vim with command sequences like:
:Tony I-have-an-edit-problem
or
:Tony umlaut-not-working
or
:Tony <your problem here>
For me as a still-vim-newbie it is often difficult to analyse the
root of the "problems" I have with vim.
But hopefully this will change one day.
Boring or not: Thanks a lot for your kind help, Tony!!! :O)))))))))\+
Keep hacking!
mcc
PS:
There is still a question open to me, Tony...
On a german keyboard you have to press Ctrl-AltGr-9 to jump to
a tag under the cursor, which is originally Ctrl-].
This again is bad finger-Yoga (at least for my fingers...;)
This is one reason why I wanted used the umlauts in normalmode to act
as "[","]","{" and "}" (no one needs gemran umaluts in normal mode,
so I will loose nothing...)
Unfortunately Ctrl-umlaut-a (umlaut-a is mapped to ] now...) does not
work as tag-inator. Is this one of these
certain-special-keys-cannot-be-used-in-mappings problem, is this due
to the "nnoremap" (instead of nmap...), which forbids later
re-remapping, do I have to remap this sepeartely or am I simply to
stupid ? ;)
Keep hacking II !
mcc