1

I want to use different config files for different directories. For example, if I want to use different plugins(via a plugin manager) or use different color themes. Is there a way to do so?

3
  • 1
    Welcome to Vi and Vim!
    – D. Ben Knoble
    Jul 18 '20 at 12:06
  • 1
    I think you could probably get away with setting the VIMINIT variable to adjust the runtimepath based on the current directory. Or even do that in your vimrc. And use plugin/ files for the custom stuff
    – D. Ben Knoble
    Jul 18 '20 at 12:08
  • 1
    I think this question I asked a few years ago could be useful.
    – statox
    Jul 19 '20 at 12:01
1

I guess you could use any local vimrc plugin as long as your plugin manager supports on-the-fly loading of plugins.

The almost related Q/A here is missing a few contestants: How to make vimrc settings applicable for a directory tree only. The one on SO is a little bit more complete: https://stackoverflow.com/questions/456792/vim-apply-settings-on-files-in-directory/456889#456889

Note that we cannot use different colorthemes simultaneously in a same vim session. At best the colortheme would change every time you jump into a buffer from a different project -- it would quickly become annoying IMO.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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