On Mon 19-Feb-07 11:13am -0600, [EMAIL PROTECTED] wrote:

> I think I should point out that AsNeeded provides
> transparent support for plugin loading for commands and
> functions -- ie. issue a command, and if the associated
> plugin hasn't been loaded yet, it will be, and the command
> is then executed or the function executed.
>
> However, the surround.vim plugin is largely providing
> maps.  AsNeeded supports maps; but not transparently.  For
> surround.vim, for example:
>
>   :AN cs
>
> will load the surround.vim plugin and make the cs map
> available.

AsNeeded does a great job of supporting mapping as long as
the maps are predefined or loaded in my vimrc and map to
commands know by AsNeeded.

As you've pointed out, this is not the case with the
surround.vim plugin.  I've gotten around this problem by
bypassing AsNeeded and splitting the plugin into two
components: just the maps in plugin\surroundPlugin.vim, and
all the functions in autoload\surround.vim.

This was very easy to do and accomplishes the goal of not
loaded all the functions until one is needed.

BTW, as an enhancement request, could AN be enhanced to look
for <leader>map when it fails to find <char>map?  That is,
if I want to load the align maps:

    AN \abox

doesn't work.  I would need to type:

    AN <leader>abox

-- 
Best regards,
Bill


Reply via email to