I'm using vim-plug for managing plugins, primarily for its lazy-loading capabilities. This lets me do:Plug 'Valloric/YouCompleteMe', { 'do': 'python2 ./install.py --clang-completer --gocode-completer --tern-completer', }I don't have YCM in all systems where I do have my .vim present and updated, and sometimes I'm not interested in having it present or installed - Supertab suffices for my needs in these cases, and installing YCM takes too much time, and YCM itself might be too heavyweight.Now, I can skip the build step, since it is a shell command and I can probably do something like 'do': '[[ -z $INSTALL_YCM ]] && python2 '. Can I get vim-plug to skip cloning the YCM plugin altogether? It has a bunch of submodules (and submodules within submodules  it's turtles all the way down), and downloading all that would just be a waste of time and bandwidth.YCM is just an example. As I add more plugins (I have 17 now, and as I understand, some users have twice as many), I would be interested in skipping plugins on systems where they have no use at all. So, don't focus on YCM.
Can I get vim-plug to skip installing a plugin, based on some Vimscript condition?
plugin vim plug
As noted in the comments, you can use Vimscript within the vim-plug block, so I ended up checking for particular commands to control installation of plugins. For example, I rarely have cmake installed, I usually install it for YCM. So a executable('cmake') check is good enough for that. Now, my vim-plug block has one section for common plugins, and a set of checks for those which are useful in specific cases: call plug#begin() Common pluginsPlug 'vim-scripts/diffchar.vim'Plug 'scrooloose/nerdtree'Plug 'ervandew/supertab'Plug 'scrooloose/syntastic'Plug 'tpope/vim-surround'Plug 'bling/vim-airline'Plug 'tpope/vim-fugitive'Plug 'tomasr/molokai'Plug 'ctrlpvim/ctrlp.vim'Plug 'gabrielelana/vim-markdown', {'for': 'markdown'}Plug 'majutsushi/tagbar', {'for': ['cpp', 'c', 'go', 'sh', 'js']}Plug 'godlygeek/tabular'if executable('cmake')     YCM command lifted from vim-plug readme    Plug 'Valloric/YouCompleteMe', { 'do': YCMInstallCmd(), 'for': ['cpp', 'c', 'go', 'sh', 'js', 'vim'] }    autocmd! User YouCompleteMe if !has('vim_starting') | call youcompleteme#Enable() | endifendifif executable('go')    Plug 'fatih/vim-go', {'for': 'go'}endifif executable('latex')    Plug 'lervag/vimtex', {'for': 'tex'}endifif executable('ghc')    Plug 'dag/vim2hs', {'for': 'hs'}endifif executable('man')    Plug 'murukeshm/vim-manpager'endifif executable('dpkg')    Plug 'vim-scripts/deb.vim'endifif executable('logrotate')    Plug 'moon-musick/vim-logrotate'endifcall plug#end()