From b2208640d4c2aa5bf14192840becaa7c0789302b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 27 Jul 2014 11:06:47 +0900 Subject: [PATCH] Update documentation --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ plug.vim | 4 ++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8dac6d0..e17a198 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,42 @@ Plug 'tpope/vim-fireplace', { 'for': 'clojure' } Plug 'junegunn/vader.vim', { 'on': 'Vader', 'for': 'vader' } ``` +### Post-installation/update hooks + +There are some plugins that require extra steps after installation or update. +In that case, use `do` option to describe the task to be performed. + +```vim +Plug 'Valloric/YouCompleteMe', { 'do': './install.sh' } +``` + +If you need more control, you can pass a reference to a Vim function instead. + +```vim +function! BuildYCM() + " ... +endfunction + +Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') } +``` + +Both forms of post-update hook are executed inside the directory of the plugin. + +Make sure to escape BARs when you write `do` option inline as they are +mistakenly recognized as command separator for Plug command. + +```vim +Plug 'junegunn/fzf', { 'do': 'yes \| ./install' } +``` + +But you can avoid the escaping if you extract the inline specification using a +variable (or any Vimscript expression) as follows: + +```vim +let g:fzf_install = 'yes | ./install' +Plug 'junegunn/fzf', { 'do': g:fzf_install } +``` + ### Dependency resolution See [Dependency @@ -186,6 +222,13 @@ it as "unstable" or "in development", and always use its latest revision. If you really must choose a certain untagged revision, consider forking the repository. +#### Migrating from other plugin managers + +vim-plug does not require any extra statement other than `plug#begin()` and +`plug#end()`. You can remove `filetype off`, `filetype plugin indent on` and +`syntax on` from your .vimrc as they are automatically handled by +`plug#end()`. + ### License MIT diff --git a/plug.vim b/plug.vim index 64c61b3..08b5442 100644 --- a/plug.vim +++ b/plug.vim @@ -30,8 +30,8 @@ " " call plug#end() " -" Then :PlugInstall to install plugins. (default: ~/.vim/plugged) -" You can change the location of the plugins with plug#begin(path) call. +" Then reload .vimrc and :PlugInstall to install plugins. +" Visit https://github.com/junegunn/vim-plug for more information. " " " Copyright (c) 2014 Junegunn Choi