Monday, November 30, 2009

Re: & xmledit

On 2009-11-29, Andy Wokula wrote:
> Tuo Pe schrieb:
> > --- On Fri, 11/27/09, Andy Wokula <anwoku@yahoo.de> wrote:
> >
> >> :let maplocalleader = ','
> >>
> >> is a setting for the vimrc: controlled by the user, constant
> >> throughout the session.
> >
> > So this means that I should use mapleader instead of maplocalleader?
> > And that I should set in in .vimrc, not in .vim/ftplugin/ files etc?
> >
> > Tuomas
>
> No, you should stay with maplocalleader, but just define it in the
> vimrc.
>
>
> g:mapleader -> <Leader>
> g:maplocalleader -> <LocalLeader>
>
> It is a convention that global plugins should define mappings with
> <Leader> and filetype plugins with <LocalLeader>.
>
> :h <Leader>
> :h <LocalLeader>

But what Tuo Pe wants to do is change the leader for only the XML
mappings. He doesn't want it constant throughout the session, at
least as I understood his original question.

It seems to me that, according to Vim's documentation, setting
maplocalleader any time before the mappings of xml.vim were defined
should have worked.

As an experiment, I created a file with the contents shown here:

map <LocalLeader>X :echo "hello X"<CR>
let maplocalleader = ","
map <LocalLeader>Y :echo "hello Y"<CR>
let maplocalleader = ""
map <LocalLeader>Z :echo "hello Z"<CR>

and sourced it. Both the ":map" command and trying the mappings
verified that the left-hand sides of the mappings were as expected:

\X
,Y
\Z

It worked for me; I wonder why it didn't work for Tuo Pe.

Regards,
Gary


--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment