Add operating system specific plugins and options section

This commit is contained in:
Marcel Bischoff 2017-06-27 02:55:29 +02:00 committed by GitHub
parent 802b100415
commit 1e96cc6073

View File

@ -261,6 +261,22 @@ let g:fzf_install = 'yes | ./install'
Plug 'junegunn/fzf', { 'do': g:fzf_install } Plug 'junegunn/fzf', { 'do': g:fzf_install }
``` ```
### Operating system specific plugins and options
While this functionality is not built into the plugin, you can easily archieve this with Vim's own commands. For example configuring the post-update hooks for `vimproc` differently on FreeBSD:
```vim
let g:os=substitute(system('uname'), '\n', '', '')
if g:os ==# 'FreeBSD'
Plug 'Shougo/vimproc', { 'do': 'gmake' }
else
Plug 'Shougo/vimproc', { 'do': 'make' }
endif
```
This approach enables you to build whatever complex plugin sets you need, depending on setting a global variable.
### `PlugInstall!` and `PlugUpdate!` ### `PlugInstall!` and `PlugUpdate!`
The installer takes the following steps when installing/updating a plugin: The installer takes the following steps when installing/updating a plugin: