vim-plug icon indicating copy to clipboard operation
vim-plug copied to clipboard

How should I manage plugins across two .vim files?

Open chrisshroba opened this issue 5 years ago • 1 comments

I currently have one vimrc which I check into source control and distribute to all machines I use, and I source a ~/.vimrc-local at the end if it exists, for any machine-specific settings.

If I have machine-specific plugins to include, is there any way to specify them using my current setup (in ~/.vimrc-local), or do I need to create a third file (.vim-plugins-local) which is sourced from within the plug#begin/plug#end block, as #425 implies? I understand that I can't have a second plug#begin/plug#end block, so I'm wondering if there are any other solutions.

  • Type:
    • [ ] Bug
    • [ ] Enhancement
    • [ ] Feature Request
    • [x] Question
  • OS:
    • [x] All/Other
    • [ ] Linux
    • [ ] OS X
    • [ ] Windows
  • Vim:
    • [x] Terminal Vim
    • [ ] GVim
    • [ ] Neovim

chrisshroba avatar Sep 21 '20 22:09 chrisshroba

The only alternative I see to having at least one more files specifiying the plugins would be to define you own syntax to include the global plugin lines as comments in one file and use some vimscript to read that file when processing the other, cut out the corresponding comments, uncomment, and source them. But personally I would probably just have the plug#begin/plug#end block in ~/.vimrc-local and source ~/.vim_plug and ~/.vim_plug-local there specifiying the global and local plugins instead of that way more hacky two-file version.

mschilli87 avatar Sep 22 '20 05:09 mschilli87