MarcWeber / vim-addon-manager

manage and install vim plugins (including their dependencies) in a sane way. If you have any trouble contact me. Usually I reply within 24 hours
Other
660 stars 59 forks source link

VAM ignored SourceCmd autocommand #115

Closed joeytwiddle closed 11 years ago

joeytwiddle commented 11 years ago

I have been using the following trick in my .vimrc to avoid loading any .vim files from the /CVS/Base/ subfolders beneath ~/.vim.

augroup ForbidCVS
    autocmd!
    autocmd SourceCmd */CVS/* :" Do nothing
    " Or more verbosely:
    "autocmd SourceCmd */CVS/* echo "Not sourcing CVS script: ".expand("<afile>")
augroup END

This trick worked fine with VAM acbe859aa0cc362762eed6b1e63aad41ce5cdb73 (Jun 27 2012) but no longer works with VAM d3036a6f1e82e57484c1f52a0d62bce4967ee4d4 (Jan 20 2013). Sorry I do not have time to track it down more accurately.

Has VAM now taken over sourcing of default ~/.vim/plugin/*/.vim scripts, overriding the default loading mechanism?

ZyX-I commented 11 years ago

Check whether setting g:vim_addon_manager.source_missing_files to zero will help. You don’t need this feature most of time in any case (it is for those users that call vam#ActivateAddons in some file in plugin/ folder).

MarcWeber commented 11 years ago

How does allowing nested autocommands fix that his trick does no longer work? joeytwiddle: Can you make me understand why the "VAM way" does not work for you? The VAM way is: Only load the plugins you need always - then load the plugins you need occasionally as needed. Thus Another fix would be moving the CVS* stuff into its own ~/.vim/vim-addons/cvs/ directory, and use :ActivateAddons cvs if you need it. Let us know if your case is solved by what ZyX did or by another solution

ZyX-I commented 11 years ago

It is not about loading CVS stuff only in some cases, but about forbidding loading from CVS subdirectories always. Reason for this behavior is simple: CVS directory contains old versions (NOT CVS stuff) (maintained by CVS) of files that are already present in working tree, and these files have names ending with .vim (this directory is for cvs like .svn for subversion). Thus it makes plugins loaded big number of times: first plugin/foo.vim, then it previous version, … When vam#SourceMissingPlugins is run in autocommand it in turn runs :source. But without nested this source does not trigger SourceCmd autocommand that forbids sourcing and we now see what we wanted not to see when defining that SourceCmd.