Closed punassuming closed 12 years ago
What about the autocmd on line 41? Is there a way to overwrite just that instance without wiping out other FileType autocmds?
Your fix makes it so Unbundle is never called on re-source. So if a file is added, it never gets unbundled. One option is to have the user always put the: "call Unbundle()" command in their vimrc file.
Also, to prevent overwriting the autocommand, I would do this:
augroup unbundle
au!
autocmd FileType * :call Unftbundle(expand('<amatch>'))
augroup END
To activate one-off bundles that you installed while Vim is still running, I suggest either:
:call Unbundle()
or :call Unftbundle()
manually in command mode.Thanks for the augroup tip. I'm still worried about the rest of the Unftbundle setup logic: when you re-source ftdetect scripts (which typically define autocommands) you are defining a duplicate set of the same autocommands that were defined the first time your vimrc (and thereby unbundle.vim
) was sourced. This redundancy will only grow each time you re-source your vimrc file and eventually cause Vim to be sluggish. :(
Alright @ralesi, I added the bangs to function declarations as you initially requested, so re-sourcing will now work as you expect. Just be aware that re-sourcing causes redundant autocommands to pile up in your Vim session. :cop:
Put a ! after the function calls (Unbundle and Unftbundle) to prevent warning when sourcing your vimrc file.