Thursday, April 28, 2011

Re: Where is defined?

Reply to message «Re: Where is <localleader> defined?»,
sent 05:26:34 28 April 2011, Thursday
by Steve Litt:

> For that reason, starting with the very first version of VO, VO's command
> prefix for special VO commands is two commas (,,). Extremely fast,
> extremely easy for the touch typist.
>
> Some time around VO 0.2.4, VO stopped hard-coding .. and began to set
> <localleader> to ,, and put <localleader> in all VO's map commands. Then
> our troubles began.
DO NOT TOUCH USER OPTIONS! If you want custom leader, use :execute, functions
from my framework, :MyMap command or whatever, but do not touch my option: I do
not want to guess why mappings are not working if you redefined maplocalleader.

In any case, I would prefer to use g:vo_mapleader rather then such options as
mapleader (<Leader>) and maplocalleader (<LocalLeader>) because they do not
allow to set leader for this plugin only and set another leader for another
plugin (without a hacks like using SourcePre autocommands). Redefining
maplocalleader is worse even if you restore it afterwards: it makes it
impossible to use that SourcePre hack.

Original message:
> On Wednesday 27 April 2011 21:04:34 Ben Schmidt wrote:
> > <localleader> to <voleader> before executing it.
> >
> > My main question though, is, why do you want to do this? Maybe if you
> > explain your motivation more, there is a more standard 'Vim way' to do
> > what you are wanting, or some other advice the list could give.
> :
> :-)(
>
> Ugh!
>
> This is for VimOutliner (VO, http://www.vimoutliner.net). THE top priority
> of VO is fast authoring. As a matter of fact, I'd go so far as to say if a
> modification makes VimOutliner slow to author, it's no longer VimOutliner.
>
> For that reason, starting with the very first version of VO, VO's command
> prefix for special VO commands is two commas (,,). Extremely fast,
> extremely easy for the touch typist.
>
> Some time around VO 0.2.4, VO stopped hard-coding .. and began to set
> <localleader> to ,, and put <localleader> in all VO's map commands. Then
> our troubles began.
>
> The Debian maintainer changed <localleader> to two backslashes or something
> like that, with the explanation that Debian must default <localleader> to
> that or it's not a Debian package.
>
> I don't know anything about that, but I can tell you that if every command
> starts with \\, it's not VimOutliner, it's some poke slow piece of
> software.
>
> So the best of both worlds is to stop using <localleader> for the VO
> command prefix.. Personally I'd just hardcode ,, but there seems to be
> some resistance to that -- maybe for a reason similar to an aversion to
> magic numbers. Or maybe because a person missing their right middle finger
> would want to change that command prefix.
>
> So anyway, all we have to do is define a command or key or variable or
> whatever that isn't currently a part of Vim, and that way the Debian people
> can define <localleader> however they want, and we can default our command
> prefix to the tried and true ,,.
>
> So, within that context, what do you think?
>
> Thanks
>
> SteveT
>
> Steve Litt
> Recession Relief Package
> http://www.recession-relief.US
> Twitter: http://www.twitter.com/stevelitt

No comments: