Matt Wozniski schrieb:
> On Mon, May 4, 2009 at 12:51 PM, Ben Fritz wrote:
>   
>> On May 4, 11:47 am, "Torsten A."  wrote:
>>     
>>> I checked the vim help and found the ~/.vim/after directory, which is
>>> supposed to be scanned __after__ the plugins are loaded. I tried to add
>>> my script setting the plugin path in the "after" directory, but the
>>> script is never executed. Currently I got in ~/.vim/after/my_project.vim
>>> only the lines
>>>
>>> :Project project.vim
>>> :alsdjflajds
>>>       
>> Looks like you're very close!
>>
>> The after directory (for plugins) is ~/.vim/after/plugin, not directly
>> in the after directory.
>>     
>
> This is right...
>
>   
>> Additionally, you need to give your file the same name as the plugin
>> script that exists in the ~/.vim/plugin directory.
>>     
>
> But this isn't.  This would be true for ftplugins or syntax files, but
> not for plugins.  The file can have any name at all, it will be
> executed no matter what.  Now, since you probably don't want it to
> trigger unless the project.vim plugin exists and was loaded, you
> probably want to start your after/plugin/foo.vim with something like
>
> if !exists('Project')
>   finish " The :Project command isn't available!  Bail!
> endif
>
> ~Matt
>
> >
>   
Thanks a lot everyone! Too easy. Though I think the vim help is not very
precise. I think it doesn't say it has to be the same tree again.

One quick additional comment: Since Project is a plugin, it needs to be

if !exists(':Project')
  finish " The :Project command isn't available!  Bail!
endif

Cheers,
    Torsten


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

Reply via email to