Managing dependencies

Junegunn Choi 2016-12-17 18:30:21 +09:00
parent f487e0acad
commit f20324db58

28
faq.md

@ -189,6 +189,34 @@ delc PlugUpgrade
Unlike `PlugUpgrade`, you'll have to restart Vim after vim-plug is updated.
### Managing dependencies
vim-plug no longer handles [dependencies between plugins](https://github.com/junegunn/vim-plug/wiki/plugfile) and it's up to the user to manually specify `Plug` commands for dependent plugins.
```vim
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
```
Some users prefer to use `|` separators or arbitrary indentation to express plugin dependencies in their configuration files.
```vim
" Vim script allows you to write multiple statements in a row using `|` separators
" But it's just a stylistic convention. If dependent plugins are written in a single line,
" it's easier to delete or comment out the line when you no longer need them.
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Plug 'junegunn/fzf', { 'do': './install --all' } | Plug 'junegunn/fzf.vim'
" Using manual indentation to express dependency
Plug 'kana/vim-textobj-user'
Plug 'nelstrom/vim-textobj-rubyblock'
Plug 'whatyouhide/vim-textobj-xmlattr'
Plug 'reedes/vim-textobj-sentence'
```
- Ordering of plugins only matters when overriding an earlier plugin's commands or mappings, so putting the dependency next to the plugin that depends on it or next to other plugins' dependencies are both okay.
- In the rare case where plugins do overwrite commands or mappings, vim-plug requires you to manually reorder your plugins.
### What's the deal with `git::@` in the URL?
When vim-plug clones a repository, it injects `git::@` into the URL (e.g. `https://git::@github.com/junegunn/seoul256.vim.git`) which can be an issue when you want to push some changes back to the remote. So why?