Re: Mapping german umlauts

2006-10-09 Thread A.J.Mechelynck

Meino Christian Cramer wrote:

From: "A.J.Mechelynck" <[EMAIL PROTECTED]>
Subject: Re: Mapping german umlauts
Date: Sun, 08 Oct 2006 17:28:51 +0200


Meino Christian Cramer wrote:
[...]

 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
Mapping something to ] doesn't map anything to Ctrl-], you have to do it 
separately.


On my Belgian keyboard on SUSE Linux, CTRL doesn't work with any nonalphabetic 
printable key (in particular, it doesn't work with "]"). There are two solutions:


a) Use the mouse (double-clicking a help hyperlink activates it)

b) Use a mapping.

I use

:map  

but of course you can use any {lhs} that suits you if you don't like F9. Since 
this key has no counterpart you might for instance map ß to it, since no one 
needs the eszett in Normal mode either.




Best regards,
Tony.



Hi Tony,

 things are becoming better !
 Using the umlauts for "{","[","]" and "}" makes things a lot easier
 and far more convenient.

 But there are still things I dont understand...as always...sorry...

 I did the following:

  " LATIN SMALL LETTER SHARP S
  noremap  
  " LATIN CAPITAL A WITH DIAERESIS
  noremap  }
  " LATIN CAPITAL O WITH DIAERESIS
  noremap  {
  " LATIN SMALL A WITH DIAERESIS
  noremap  ]
  " LATIN SMALL O WITH DIAERESIS
  noremap  [

 which works in normal mode. In insert mode the umlauts appears as
 umlauts as it should be. But: WHY?

 If I understood the according help correctly "noremap" is a short
 form of "no remap". And it is not bound to any mode -- and
 "_n_noremap" (for example) is bound to normal mode.

 Therefore (according to my obviously wrong logic...;) the above
 mapping would apply also to insert mode. But it does not (and it
 should not, since the umlauts are needed in insert).

 More mysteriously: Using "nnoremap" -- as I think it would make the
 above mappings only to apply in normal mode -- for the above mappings
 breaks everything: no "{","[","]" or "}" at the umlaut-keys in normal
 mode.

 The other thing what I tried was to map "every" ( "every" = what I
 could find and thought it would be nice to have ) combination of
 "something" and the "{","[","]","}" to combinations with the umluat
 keys in the appropiate mode.

 I wrote:
  noremap Char-228 ]]
  noremap  [[
  noremap  []
  noremap  ][

 which works with the "mysterious charme" as described above as far as
 I could test it (normap <-> nnoremap)

 Then I did:
  vnoremap  a[
  vnoremap  a]
  vnoremap  i[
  vnoremap  i]
  vnoremap  a{
  vnoremap  a}
  vnoremap  i{
  vnoremap  i}

 for the motions in visual mode -- and it fails totally.

 Again I got stuck.

 Thanks a lot for any help in advance ! :O)

 Keep hacking!
 mcc
 

 





see ":help map-overview" (and don't be afraid to scroll).

":map" or "noremap" don't map to any mode, they map to Normal, Visual and 
Operator-pending but not to Insert and Command-line modes. To map to both 
Insert and Command-line, use ":map!" with bang (which doesn't map to Normal 
etc.). In general the same {rhs} has totally different effects in Insert and 
Command-line modes ("character entry modes") than in the other modes, so this 
distinction is sensible.


To map two characters using <> notation, use for instance

:noremap  ][

just like you would map, let's say, ":map  " to move two 
lines up and go to the left margin. Each <> group represents exactly one 
keypress, possibly including modifiers like Shift, Ctrl, Meta and/or Alt 
(and/or Command on the Macintosh).


Your vmaps are also in error.  means "with the Alt modifier" and 
 doesn't mean anything AFAIK. Keep the a's and i's outside the <> 
if you mean an actual a or i keypress.


But what's wrong with your original set of (single key) mappings? They should 
produce (and more economically) the same results as all the two-key 
combinations you could imagine. Oh -- and ":noremap" is not a short form of 
":no remap" (the latter doesn't work), it's a variant of ":map" which forbids 
remapping.



Best regards,
Tony.


Re: Mapping german umlauts

2006-10-08 Thread Meino Christian Cramer
From: "A.J.Mechelynck" <[EMAIL PROTECTED]>
Subject: Re: Mapping german umlauts
Date: Sun, 08 Oct 2006 17:28:51 +0200

> Meino Christian Cramer wrote:
> [...]
> >  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
> 
> Mapping something to ] doesn't map anything to Ctrl-], you have to do it 
> separately.
> 
> On my Belgian keyboard on SUSE Linux, CTRL doesn't work with any 
> nonalphabetic 
> printable key (in particular, it doesn't work with "]"). There are two 
> solutions:
> 
> a) Use the mouse (double-clicking a help hyperlink activates it)
> 
> b) Use a mapping.
> 
> I use
> 
>   :map  
> 
> but of course you can use any {lhs} that suits you if you don't like F9. 
> Since 
> this key has no counterpart you might for instance map ß to it, since no one 
> needs the eszett in Normal mode either.
> 
> 
> 
> Best regards,
> Tony.
> 

Hi Tony,

 things are becoming better !
 Using the umlauts for "{","[","]" and "}" makes things a lot easier
 and far more convenient.

 But there are still things I dont understand...as always...sorry...

 I did the following:

  " LATIN SMALL LETTER SHARP S
  noremap  
  " LATIN CAPITAL A WITH DIAERESIS
  noremap  }
  " LATIN CAPITAL O WITH DIAERESIS
  noremap  {
  " LATIN SMALL A WITH DIAERESIS
  noremap  ]
  " LATIN SMALL O WITH DIAERESIS
  noremap  [

 which works in normal mode. In insert mode the umlauts appears as
 umlauts as it should be. But: WHY?

 If I understood the according help correctly "noremap" is a short
 form of "no remap". And it is not bound to any mode -- and
 "_n_noremap" (for example) is bound to normal mode.

 Therefore (according to my obviously wrong logic...;) the above
 mapping would apply also to insert mode. But it does not (and it
 should not, since the umlauts are needed in insert).

 More mysteriously: Using "nnoremap" -- as I think it would make the
 above mappings only to apply in normal mode -- for the above mappings
 breaks everything: no "{","[","]" or "}" at the umlaut-keys in normal
 mode.

 The other thing what I tried was to map "every" ( "every" = what I
 could find and thought it would be nice to have ) combination of
 "something" and the "{","[","]","}" to combinations with the umluat
 keys in the appropiate mode.

 I wrote:
  noremap Char-228 ]]
  noremap  [[
  noremap  []
  noremap  ][

 which works with the "mysterious charme" as described above as far as
 I could test it (normap <-> nnoremap)

 Then I did:
  vnoremap  a[
  vnoremap  a]
  vnoremap  i[
  vnoremap  i]
  vnoremap  a{
  vnoremap  a}
  vnoremap  i{
  vnoremap  i}

 for the motions in visual mode -- and it fails totally.

 Again I got stuck.

 Thanks a lot for any help in advance ! :O)

 Keep hacking!
 mcc
 

 


Re: Mapping german umlauts

2006-10-08 Thread A.J.Mechelynck

Meino Christian Cramer wrote:
[...]

 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


Mapping something to ] doesn't map anything to Ctrl-], you have to do it 
separately.


On my Belgian keyboard on SUSE Linux, CTRL doesn't work with any nonalphabetic 
printable key (in particular, it doesn't work with "]"). There are two solutions:


a) Use the mouse (double-clicking a help hyperlink activates it)

b) Use a mapping.

I use

:map  

but of course you can use any {lhs} that suits you if you don't like F9. Since 
this key has no counterpart you might for instance map ß to it, since no one 
needs the eszett in Normal mode either.




Best regards,
Tony.


Re: Mapping german umlauts

2006-10-08 Thread Meino Christian Cramer
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  <[>
> >  nnoremap  <]>
> >  nnoremap  <{>
> >  nnoremap  <}>
> > 
> >  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  notation, e.g.
> 
>   exe "noremap  }"  | " LATIN CAPITAL A WITH DIAERESIS
>   exe "noremap  {"  | " LATIN CAPITAL O WITH DIAERESIS
>   exe "noremap  ]"  | " LATIN SMALL A WITH DIAERESIS
>   exe "noremap  ["  | " 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 0xC4LATIN CAPITAL A WITH DIAERESIS
>   Ö   214 0xD6LATIN CAPITAL O WITH DIAERESIS
>   Ü   220 0xDCLATIN CAPITAL U WITH DIAERESIS
>   ß   223 0xDFLATIN SMALL LETTER SHARP S
>   ä   228 0xE4LATIN SMALL A WITH DIAERESIS
>   ö   246 0xF6LATIN SMALL O WITH DIAERESIS
>   ü   252 0xFCLATIN SMALL U WITH DIAERESIS
> 
> see
>   :help 
>   :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 

 
 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

 


Re: Mapping german umlauts

2006-10-08 Thread A.J.Mechelynck

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  <[>
 nnoremap  <]>
 nnoremap  <{>
 nnoremap  <}>

 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  notation, e.g.

exe "noremap  }"  | " LATIN CAPITAL A WITH DIAERESIS
exe "noremap  {"  | " LATIN CAPITAL O WITH DIAERESIS
exe "noremap  ]"  | " LATIN SMALL A WITH DIAERESIS
exe "noremap  ["  | " 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 0xC4LATIN CAPITAL A WITH DIAERESIS
Ö   214 0xD6LATIN CAPITAL O WITH DIAERESIS
Ü   220 0xDCLATIN CAPITAL U WITH DIAERESIS
ß   223 0xDFLATIN SMALL LETTER SHARP S
ä   228 0xE4LATIN SMALL A WITH DIAERESIS
ö   246 0xF6LATIN SMALL O WITH DIAERESIS
ü   252 0xFCLATIN SMALL U WITH DIAERESIS

see
:help 
:help :scriptencoding
http://www.unicode.org/charts/PDF/U0080.pdf
etc.


Best regards,
Tony.


Mapping german umlauts

2006-10-07 Thread Meino Christian Cramer
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  <[>
 nnoremap  <]>
 nnoremap  <{>
 nnoremap  <}>

 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