Monday 15 February 2010

vim - How to enable a plugin manager without ~/.vimrc -


After using VIM for some time, my ~ / .vim / With the beginning Vim started experimenting with it and got messed up over time. So I thought, it would be time to clean up and start with the plugin manager with a clean configuration.

As I share my configuration on several machines, I usually use my ~ / .vim / path with a GIT repo a bigger. To avoid Vimrc, I have kept my own configuration under ~ / .vim / plugin / . This allows me to keep all my shared configuration in this folder and only use ~ / .vimrc for machine dependent configuration.

Starting with VAM on NeoBundle and now Vundle I always have the same problem if I ~ / .vimrc instead of ~ / .vim / plugin / pluginmanager.vim , the installed plugins are not loaded or only partially loaded. The command : echo and rpt lists the correct bundles, but plugins installed in : script name are not included if I mv ~ / .vim / plugin / Pluginmanager.vim ~ / .vimrc execute then everything works as expected.

Can anyone explain this behavior and possibly provide a solution?

My pluginmanager.vim looks like this:

  set character must be set to "iMproved, close the required file type" expected " Set Runtime Path to include the Wand Start RTP + = ~ / .vim / bundle / Vundle.vim Call Wandal # Start () "Manage Vandal Vandal, Required Plugin", gmarik / vundle.vim 'plugin' bling / Vim- Airline 'plugin' MarcWeber / vim-addon-Mw-utils 'plugin' TomTom / Tibba_wim 'plugin' Clothing / Vime-Snippet 'plugin' hone All your plugins should be added before "All / Line Snippets" "All following line call call vandle # end ()" required file type plugin indent "required  

My Vime Installation Version 7.4 .52 is

The problem is in the startup order. Your ~ / .vimrc is executed after the (as the first thing during startup), Vim runs something like : runtime! / * To load plugins Vim as soon as your plugin manager applies only, changes to 'runrintip' that triggering : runtime does not reach the command yet, and load plugins Fail in

There are several functions:

  • Move your script to ~ / .vim / pluginmanager.vim and explicitly : Runtime pluginmanager.vim (each copy) from your ~ / .vimrc .
  • Re-triggered by : runtime! Plugin / *. Vim .

But I agree with Bratenomies that the best solution would be to use ~ / .vimrc , and instead keep system-specific configuration in a different script.


No comments:

Post a Comment