Thanks, Tony, it works. It should be documented or mentioned. :help
iminsert says nothing about it, as far as I understand.

Rergs,
Milan

On Fri Mar 09, 2007 at 04:30:03PM +0100, A.J.Mechelynck wrote:
> Milan Berta wrote:
> > Hi,
> > 
> > using: VIM - Vi IMproved 7.0 (2006 May 7, compiled Feb  6 2007 18:55:12)
> > Included patches: 1-188
> > 
> > when I load any keymaps after each other the b:keymap_name variable
> > vanish after loading the second keymap and never appears again.
> > 
> > So,
> > - open vim $vim -u NONE --noplugin
> > - :echo b:keymap_name #error message, the value doesn't exist, OK, true
> > - :setlocal keymap=esperanto #or whatever else
> > - :echo b:keymap_name #Eo message, OK, true
> > - :setlocal keymap=esperanto #or whatever else
> > - :echo b:keymap_name #error message, the value doesn't exist, ???, it's
> > like :unlet b:keymap_name.
> > 
> > Strange enough: the %k variable in the statusline works well all the
> > time -- shows the right value: either nothing, or <lang> = nothing, or
> > <Eo>. But it depends on the b:keymap_name value which stops to exist at
> > some time.
> > 
> > I couldn't find anything, which would point to a vanishing variable of
> > b:keymap_name (which is actually defined in every keymap file) in the
> >  documentation or help:
> > - help keymap
> > - help loadkeymap
> > - help statusline
> > 
> > Regs,
> > Milan
> > 
> 
> Apparently, to change keymaps in a buffer where a keymap is defined, you 
> need to clear both the 'keymap' and 'iminsert' options:
> 
>       :setlocal keymap=esperanto
>       :setlocal keymap= iminsert=0 keymap=accents
> 
> works (%k on the status line shows <acc> which is the b:keymap_name for the 
> "accents" keymap).
> 
> Note that setting 'keymap' (from empty to nonempty) also sets 'iminsert' 
> (from 0 to 1).
> 
> 
> Best regards,
> Tony.

Reply via email to