Friday, June 15, 2012

Re: What is the purpose of the mappings proposed in :help write-plugin

On Tue, Jun 12, 2012 at 12:17 AM, Jacobo de Vera <devel@jacobodevera.com> wrote:
> Hi All,
>
> I have been carefully reading :help write-plugin but I can't get to
> understand why the <SID>-on-the-lhs mappings exist, what their purpose
> is.
>
> Docs say:
>
>> Thus when a user types "\a", this sequence is invoked: >
>>
>>        \a  ->  <Plug>TypecorrAdd  ->  <SID>Add  ->  :call <SID>Add()
>>
>
> But why not skip <SID>Add and Link <Plug>TypecorrAdd directly to :call
> <SID>Add() ?
>

Maybe this topic is as confusing for everybody as it is for me. I've
taken a look at some plugins and I have not been able to find any
instances of this intermediate step happening, they would map the
<Plug> mapping directly to the function call.

Perhaps the help text should be reworded?

regards,

--
Jacobo de Vera

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: