Browse Source

Merge abfac79354 into a864467285

pull/557/merge
av3r4ge 11 years ago
parent
commit
c0c4e4b9d3
4 changed files with 47 additions and 17 deletions
  1. +3
    -3
      autoload/vundle.vim
  2. +22
    -11
      autoload/vundle/installer.vim
  3. +6
    -1
      autoload/vundle/scripts.vim
  4. +16
    -2
      doc/vundle.txt

+ 3
- 3
autoload/vundle.vim View File

@ -8,8 +8,8 @@
com! -nargs=+ -bar Plugin
\ call vundle#config#bundle(<args>)
com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginInstall
\ call vundle#installer#new('!' == '<bang>', <q-args>)
com! -nargs=* -bang -complete=custom,vundle#scripts#complete PluginInstall
\ call vundle#installer#new('!' == '<bang>', <f-args>)
com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginSearch
\ call vundle#scripts#all('!' == '<bang>', <q-args>)
@ -24,7 +24,7 @@ com! -nargs=0 PluginDocs
\ call vundle#installer#helptags(g:bundles)
" Aliases
com! PluginUpdate PluginInstall!
com! -nargs=* -complete=custom,vundle#scripts#complete PluginUpdate PluginInstall! <args>
" Vundle Aliases
com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall PluginInstall<bang> <args>


+ 22
- 11
autoload/vundle/installer.vim View File

@ -6,20 +6,31 @@
" ... -- any number of bundle specifications (separate arguments)
" ---------------------------------------------------------------------------
func! vundle#installer#new(bang, ...) abort
let bundles = (a:1 == '') ?
\ g:bundles :
\ map(copy(a:000), 'vundle#config#bundle(v:val, {})')
" No specific plugins are specified. Operate on all plugins.
if a:0 == 0
let bundles = g:bundles
" Specific plugins are specified for update. Update them.
elseif (a:bang)
let bundles = filter(copy(g:bundles), 'index(a:000, v:val.name) > -1')
" Specific plugins are specified for installation. Install them.
else
let bundles = map(copy(a:000), 'vundle#config#bundle(v:val, {})')
endif
let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec'))
call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:bundle_dir, 1)], names + ['Helptags'])
if empty(bundles)
echoerr 'No bundles were selected for operation'
else
let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec'))
call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:bundle_dir, 1)], names + ['Helptags'])
" This calls 'add' as a normal mode command. This is a buffer local mapping
" defined in vundle#scripts#view(). The mapping will call a buffer local
" command InstallPlugin which in turn will call vundle#installer#run() with
" vundle#installer#install().
call s:process(a:bang, (a:bang ? 'add!' : 'add'))
" This calls 'add' as a normal mode command. This is a buffer local mapping
" defined in vundle#scripts#view(). The mapping will call a buffer local
" command InstallPlugin which in turn will call vundle#installer#run() with
" vundle#installer#install().
call s:process(a:bang, (a:bang ? 'add!' : 'add'))
call vundle#config#require(bundles)
call vundle#config#require(bundles)
endif
endf


+ 6
- 1
autoload/vundle/scripts.vim View File

@ -39,7 +39,12 @@ endf
" candidates, see also :h command-completion-custom
" ---------------------------------------------------------------------------
func! vundle#scripts#complete(a,c,d)
return join(s:load_scripts(0),"\n")
" Return only installed plugins if updating
if match(a:c, '\v^Plugin%(Install!|Update)') == 0
return join(map(copy(g:bundles), 'v:val.name'), "\n")
else
return join(s:load_scripts(0),"\n")
endif
endf


+ 16
- 2
doc/vundle.txt View File

@ -244,8 +244,16 @@ PluginInstall allows installation of plugins by name:
>
:PluginInstall unite.vim
Installs and activates unite.vim. You can use Tab to auto-complete known
script names. Note that the installation just described isn't permanent. To
Installs and activates unite.vim.
PluginInstall also allows installation of several plugins separated by space.
>
:PluginInstall tpope/vim-surround tpope/vim-fugitive
Installs both tpope/vim-surround and tpope/vim-fugitive from GitHub.
You can use Tab to auto-complete known script names.
Note that the installation just described isn't permanent. To
finish, you must put `Plugin 'unite.vim'` at the appropriate place in your
`.vimrc` to tell Vundle to load the plugin at startup.
@ -263,6 +271,12 @@ Installs or updates the configured plugins. Press 'u' after updates complete
to see the change log of all updated bundles. Press 'l' (lowercase 'L') to
see the log of commands if any errors occurred.
To update specific plugins, write their names separated by space:
>
:PluginInstall! vim-surround vim-fugitive
or >
:PluginUpdate vim-surround vim-fugitive
3.5 SEARCHING PLUGINS ~
*vundle-plugins-search* *:PluginSearch*
>


Loading…
Cancel
Save