Can .vimrc be divided into multiple files

vimvimrc

Say I have some hundred custom re-mappings with iab for Java and some other hundred or so re-mappings for Haskell, then I'd want do divide these into different files to make it more manageable. What I'm looking for is to create something like this:

~/.
 ├── .vimrc
 └── .vim
     └── custom
         ├── java.vim
         └── haskell.vim

Where .vimrc might look something like

import java
import haskell

Is something like this possible to do, or am I just overcomplicating things? I guess what I am trying to achive is what one does in LaTeX with the \input command…

Best Answer

You are looking for ftplugins. This is their purpose.

And don't forget to define your mappings, setting, abbreviation, commands, ... as local. Otherwise they'll parasite other buffers once loaded.

Here are some more complete answers:

Related Question