The Need, the Goal...
By "project-based config" I mean a project contained in a git repo that contains all the vim configuration -- vimrc and plugins and colorschemes -- right there in the repo. In my case this is in the repo's .config
directory.
So: cd path/to/project && vi -u .config/vimrc some-script.py
should... somehow ...load all the plugins/colorschemes contained in that .config
directory, ignoring the standard ~/.vimrc
and ~/.vim/*
config files.
Possible Strategies
- Plugin manager:
- vundle
- pathogen
- vim-plug
- a plugin made for this
- like https://github.com/LucHermitte/local_vimrc as a possibility
- manual configuration
- perhaps has multiple ways it could be achieved?
- magic:
- vim considers
~/.vimrc
and~/.vim/
to always be siblings so if you dovi -u path/to/config/vimrc
since vim is smart it will automatically look for plugins insidepath/to/config/vim
- vim considers
- something else?
Problems
Well...
- #4 doesn't seem to exist.
- #2 doesn't match my criteria, as "an automatic way of sourcing vimrc from current directory" is a different use-case, I don't want automatic, it should require explicit intention by invoking
-u
or something comparable. - #1: I've used pathogen for years, but I'm not sure if it's even capable of this. I tried using vim-plug and could get that working in the same way pathogen works (with standard location of config files) but couldn't get it working for this use case.
- #3 I've spent hours reading
:h packages
,:h packpath
,:h runtimepath
, and trying to derive a solution from them but nothing yet works. The trouble here is that:h packages
is not clear about the distinction betweenfoo
andfoobar
in the context of a plugin that we find off Github (it describes unzipping individually zipped files). Not a single plugin has I've seen has astart
oropt
directory, but it says to manually create that, though it's not explicitly clear about "where"... so just guess, and try every option! I did this to no avail. Additionally,:h packpath
is not helpful and:h packages
has no mention of it... but these two things might need to be used in tandem(?).