Support plugin pinning

New supported option called 'pinned' for the Plugin command. When set to
1, the plugin is added to rtp but no install/upgrade operation is
performed.

It not only allows vundle to do rtp management of plugins on VCS other
than git, it also allows leaving plugins that had previously been
managed by vundle in the current state, with no further updates.

Fixes #24, #397
This commit is contained in:
Jacobo de Vera 2011-11-10 23:50:31 +00:00
parent 0152571eb5
commit f3da68779a
5 changed files with 40 additions and 1 deletions

View File

@ -54,6 +54,7 @@ sign define Vu_new text=+ texthl=Comment
sign define Vu_updated text=* texthl=Comment
sign define Vu_deleted text=- texthl=Comment
sign define Vu_helptags text=* texthl=Comment
sign define Vu_pinned text== texthl=Comment
endif

View File

@ -134,3 +134,7 @@ func! s:bundle.path()
return s:expand_path(g:bundle_dir.'/'.self.name)
endf
func! s:bundle.is_pinned()
return get(self, 'pinned')
endf

View File

@ -67,6 +67,8 @@ func! vundle#installer#run(func_name, name, ...) abort
echo n.' deleted'
elseif 'helptags' == status
echo n.' regenerated'
elseif 'pinned' == status
echo n.' pinned'
elseif 'error' == status
echohl Error
echo 'Error processing '.n
@ -219,6 +221,11 @@ func! s:helptags(rtp) abort
endf
func! s:sync(bang, bundle) abort
" Do not sync if this bundle is pinned
if a:bundle.is_pinned()
return 'pinned'
endif
let git_dir = expand(a:bundle.path().'/.git/', 1)
if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1))
if !(a:bang) | return 'todate' | endif

View File

@ -166,6 +166,26 @@ This can be used to prevent name collisions between plugins that Vundle would
otherwise try to clone into the same directory. It also provides an additional
level of customisation.
The 'pinned' option
-------------------
A flag that, when set to a value of 1, tells Vundle not to perform any git
operations on the plugin, while still adding the existing plugin under the
`bundles` directories to the |runtimepath|.
For example:
>
Plugin 'mylocalplugin', {'pinned': 1}
This allows the users to include, with Vundle, plugins tracked with version
control systems other than git, but the user is responsible for cloning and
keeping up to date. It also allows the users to stay in the current version of
a plugin that might have previously been updated by Vundle.
Please note that the URI will be treated the same as for any other plugins, so
only the last part of it will be added to the |runtimepath|. The user is
advised to use this flag only with single word URIs to avoid confusion.
3.2 SUPPORTED URIS ~
*vundle-plugins-uris*
@ -185,7 +205,7 @@ GitHub is used when a user/repo is passed to `Plugin`.
Vim Scripts
-----------
Any single word without a '/' is assumed to be from Vim Scripts.
Any single word without a slash '/' is assumed to be from Vim Scripts.
>
Plugin 'ctrlp.vim' => https://github.com/vim-scripts/ctrlp.vim

View File

@ -58,6 +58,13 @@ Bundle 'vim-scripts/RubySinatra'
" syntax issue #203
Bundle 'jimenezrick/vimerl'
" Static bundle: Same name as a valid vim-scripts bundle
Bundle 'latte', {'pinned' : 1}
if !isdirectory(expand(bundle_dir) . '/latte')
call mkdir(expand(bundle_dir) . '/latte', 'p')
endif
filetype plugin indent on " Automatically detect file types.
set wildignore+=doc " should not break helptags