I want to separate my Vim Plugins to a separated file since I using more plugins in my .vimrc file. it this possible?

  • 1
    You might want to have a look at the plugins Pathogen and Vundle. Both allow you to easily manage plugins. Pathogen gives you a bit more control over what is going on while Vundle makes things a bit easier. – Octaviour Jun 12 '17 at 11:28

source command can do it.

You can separate files, and source them in the main file ( vimrc )


I'm not sure to correctly understand your question.

Usually when the .vimrc contains more and more functions, mappings, commands, abbreviations and so on, we split it into several files.

When the definitions should apply to any type of buffer (/file), they go in a vim script stored under ~/.vim/plugin/ (I simplify, read :h 'rtp' for more information).

When the definitions are specifics to a type of buffer (/file), they go in filetype plugins, stored under ~/.vim/ftplugin/{filetype}/.

Functions are best stored in autoload plugins. Syntax definitions in ~/.vim/syntax/` and so on.

I'm quite sure I've already explained that somewhere. May be it was on SO, I don't remember.

Not the answer you're looking for? Browse other questions tagged or ask your own question.