Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some configuration in my vimrc. Some generic ones, and some other really specific.

I would like to share this config with some co workers, but a lot of them don't need these specific ones.

Instead of editing a bunch of different vimrc, I would like to know if it's possible to have an "include" directive - something like a file named ".vimrc_module" and called from vimrc. Is it possible?

share|improve this question
up vote 46 down vote accepted

Yes, it is possible, use the :source command:

source .vimrc_module

See:

:help :source

for more information.

share|improve this answer

Plugins serve this purpose.

  • plain plugins are always loaded once,
  • autoload plugins are loaded on demand (they are ideal to define libraries of viml functions),
  • ftplugin are loaded once per buffer (when the ftplugin type matches the buffer type),
  • local vimrcs are loaded on a project-basis (non standard),
  • and so on.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .