Prototype implementation of dependency resolution (#2)

This commit is contained in:
Junegunn Choi
2013-09-25 02:08:42 +09:00
parent 1aea9fed65
commit a9d5912b4d
2 changed files with 131 additions and 50 deletions

View File

@@ -14,6 +14,7 @@ Somewhere between [Pathogen](https://github.com/tpope/vim-pathogen) and
- Parallel installation/update (requires
[+ruby](http://junegunn.kr/2013/09/installing-vim-with-ruby-support/))
- Smallest possible feature set
- Dependency resolution using `Plugfile` (experimental)
### Cons.
@@ -64,6 +65,34 @@ plugins with `plug#begin(path)` call.
(Default number of threads = `g:plug_threads` or 16)
### Dependency resolution
If a Vim plugin specifies its dependent plugins in `Plugfile` in its root
directory, vim-plug will automatically source it recursively during the
installation.
A `Plugfile` should contain a set of `Plug` commands for the dependent plugins.
I've created two dummy repositories with Plugfiles as an example to this scheme.
- [junegunn/dummy1](https://github.com/junegunn/dummy1)
- `Plug 'junegunn/vim-scroll-position'`
- `Plug 'junegunn/dummy2'`
- [junegunn/dummy2](https://github.com/junegunn/dummy2)
- `Plug 'junegunn/Zenburn'`
- `Plug 'junegunn/jellybeans.vim'`
- `Plug 'junegunn/dummy1'`
- (Circular dependencies are ignored)
If you put `Plug 'junegunn/dummy1'` in your configuration file, and run
`:PlugInstall`,
1. vim-plug first installs dummy1
2. And sees if the repository has Plugfile
3. Plugfile is loaded and vim-plug discovers dependent plugins
4. Dependent plugins are then installed as well, and their Plugfiles are
examined and their dependencies are resolved recursively.
### Articles
- [Writing my own Vim plugin manager](http://junegunn.kr/2013/09/writing-my-own-vim-plugin-manager)