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?
- 1Welcome to Vi and Vim!D. Ben Knoble– D. Ben Knoble2020-07-18 12:06:25 +00:00Commented Jul 18, 2020 at 12:06
- 1I 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 stuffD. Ben Knoble– D. Ben Knoble2020-07-18 12:08:10 +00:00Commented Jul 18, 2020 at 12:08
- 1I think this question I asked a few years ago could be useful.statox– statox2020-07-19 12:01:30 +00:00Commented Jul 19, 2020 at 12:01
1 Answer
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.