use Plugin instead Bundle
- closes many issues )
This commit is contained in:
committed by
Jeremy Pallats/starcraft.man
parent
941158665e
commit
0521de95ea
@@ -4,6 +4,48 @@
|
||||
" Readme: http://github.com/gmarik/vundle/blob/master/README.md
|
||||
" Version: 0.9
|
||||
|
||||
" Plugin Commands
|
||||
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 PluginSearch
|
||||
\ call vundle#scripts#all('!'=='<bang>', <q-args>)
|
||||
|
||||
com! -nargs=? -bang -complete=custom,vundle#scripts#complete Plugins
|
||||
\ call vundle#scripts#all('!'=='<bang>', <q-args>)
|
||||
|
||||
com! -nargs=0 -bang PluginList
|
||||
\ call vundle#installer#list('!'=='<bang>')
|
||||
|
||||
com! -nargs=? -bang PluginClean
|
||||
\ call vundle#installer#clean('!' == '<bang>')
|
||||
|
||||
com! -nargs=0 PluginDocs
|
||||
\ call vundle#installer#helptags(g:bundles)
|
||||
|
||||
" Aliases
|
||||
com! PluginUpdate PluginInstall!
|
||||
|
||||
" Vundle Aliases
|
||||
com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall
|
||||
\ call vundle#installer#new('!' == '<bang>', <q-args>)
|
||||
|
||||
com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch
|
||||
\ call vundle#scripts#all('!'=='<bang>', <q-args>)
|
||||
|
||||
com! -nargs=? -bang VundleClean
|
||||
\ call vundle#installer#clean('!' == '<bang>')
|
||||
|
||||
com! -nargs=0 VundleDocs
|
||||
\ call vundle#installer#helptags(g:bundles)
|
||||
|
||||
" Aliases
|
||||
com! VundleUpdate PluginInstall!
|
||||
|
||||
" deprecated
|
||||
com! -nargs=+ Bundle
|
||||
\ call vundle#config#bundle(<args>)
|
||||
|
||||
@@ -22,7 +64,7 @@ com! -nargs=0 -bang BundleList
|
||||
com! -nargs=? -bang BundleClean
|
||||
\ call vundle#installer#clean('!' == '<bang>')
|
||||
|
||||
com! -nargs=0 BundleDocs
|
||||
com! -nargs=0 BundleDocs
|
||||
\ call vundle#installer#helptags(g:bundles)
|
||||
|
||||
" Aliases
|
||||
|
||||
@@ -25,9 +25,9 @@ endf
|
||||
|
||||
func! vundle#config#init_bundle(name, opts)
|
||||
if a:name != substitute(a:name, '^\s*\(.\{-}\)\s*$', '\1', '')
|
||||
echo "Spurious leading and/or trailing whitespace found in bundle spec '" . a:name . "'"
|
||||
echo "Spurious leading and/or trailing whitespace found in plugin spec '" . a:name . "'"
|
||||
endif
|
||||
let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g')))
|
||||
let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g')), 'keep')
|
||||
let b = extend(opts, copy(s:bundle))
|
||||
let b.rtpath = s:rtpath(opts)
|
||||
return b
|
||||
@@ -55,7 +55,7 @@ func! s:parse_name(arg)
|
||||
let uri .= '.git'
|
||||
endif
|
||||
let name = substitute(split(uri,'\/')[-1], '\.git\s*$','','i')
|
||||
elseif arg =~? '^\s*\(git@\|git://\)\S\+'
|
||||
elseif arg =~? '^\s*\(git@\|git://\)\S\+'
|
||||
\ || arg =~? '\(file\|https\?\)://'
|
||||
\ || arg =~? '\.git\s*$'
|
||||
let uri = arg
|
||||
|
||||
@@ -4,7 +4,7 @@ func! vundle#installer#new(bang, ...) abort
|
||||
\ map(copy(a:000), 'vundle#config#bundle(v:val, {})')
|
||||
|
||||
let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec'))
|
||||
call vundle#scripts#view('Installer',['" Installing bundles to '.expand(g:bundle_dir, 1)], names + ['Helptags'])
|
||||
call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:bundle_dir, 1)], names + ['Helptags'])
|
||||
|
||||
call s:process(a:bang, (a:bang ? 'add!' : 'add'))
|
||||
|
||||
@@ -30,7 +30,7 @@ func! s:process(bang, cmd)
|
||||
endif
|
||||
|
||||
if 'updated' == g:vundle_last_status && empty(msg)
|
||||
let msg = 'Bundles updated; press u to view changelog'
|
||||
let msg = 'Plugins updated; press u to view changelog'
|
||||
endif
|
||||
|
||||
" goto next one
|
||||
@@ -81,7 +81,7 @@ func! vundle#installer#run(func_name, name, ...) abort
|
||||
return status
|
||||
endf
|
||||
|
||||
func! s:sign(status)
|
||||
func! s:sign(status)
|
||||
if (!has('signs'))
|
||||
return
|
||||
endif
|
||||
@@ -100,7 +100,14 @@ endf
|
||||
func! vundle#installer#install(bang, name) abort
|
||||
if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif
|
||||
|
||||
let b = vundle#config#init_bundle(a:name, {})
|
||||
let n = substitute(a:name,"['".'"]\+','','g')
|
||||
let matched = filter(copy(g:bundles), 'v:val.name_spec == n')
|
||||
|
||||
if len(matched) > 0
|
||||
let b = matched[0]
|
||||
else
|
||||
let b = vundle#config#init_bundle(a:name, {})
|
||||
endif
|
||||
|
||||
return s:sync(a:bang, b)
|
||||
endf
|
||||
@@ -123,21 +130,21 @@ func! vundle#installer#helptags(bundles) abort
|
||||
let statuses = map(copy(help_dirs), 's:helptags(v:val)')
|
||||
let errors = filter(statuses, 'v:val == 0')
|
||||
|
||||
call s:log('Helptags: '.len(help_dirs).' bundles processed')
|
||||
call s:log('Helptags: '.len(help_dirs).' plugins processed')
|
||||
|
||||
return len(errors)
|
||||
endf
|
||||
|
||||
func! vundle#installer#list(bang) abort
|
||||
let bundles = vundle#scripts#bundle_names(map(copy(g:bundles), 'v:val.name_spec'))
|
||||
call vundle#scripts#view('list', ['" My Bundles'], bundles)
|
||||
call vundle#scripts#view('list', ['" My Plugins'], bundles)
|
||||
redraw
|
||||
echo len(g:bundles).' bundles configured'
|
||||
echo len(g:bundles).' plugins configured'
|
||||
endf
|
||||
|
||||
|
||||
func! vundle#installer#clean(bang) abort
|
||||
let bundle_dirs = map(copy(g:bundles), 'v:val.path()')
|
||||
let bundle_dirs = map(copy(g:bundles), 'v:val.path()')
|
||||
let all_dirs = (v:version > 702 || (v:version == 702 && has("patch51")))
|
||||
\ ? split(globpath(g:bundle_dir, '*', 1), "\n")
|
||||
\ : split(globpath(g:bundle_dir, '*'), "\n")
|
||||
@@ -147,7 +154,7 @@ func! vundle#installer#clean(bang) abort
|
||||
let headers = ['" All clean!']
|
||||
let names = []
|
||||
else
|
||||
let headers = ['" Removing bundles:']
|
||||
let headers = ['" Removing Plugins:']
|
||||
let names = vundle#scripts#bundle_names(map(copy(x_dirs), 'fnamemodify(v:val, ":t")'))
|
||||
end
|
||||
|
||||
@@ -179,7 +186,7 @@ func! vundle#installer#delete(bang, dir_name) abort
|
||||
let out = s:system(cmd)
|
||||
|
||||
call s:log('')
|
||||
call s:log('Bundle '.a:dir_name)
|
||||
call s:log('Plugin '.a:dir_name)
|
||||
call s:log('$ '.cmd)
|
||||
call s:log('> '.out)
|
||||
|
||||
@@ -229,7 +236,7 @@ func! s:sync(bang, bundle) abort
|
||||
|
||||
let out = s:system(cmd)
|
||||
call s:log('')
|
||||
call s:log('Bundle '.a:bundle.name_spec)
|
||||
call s:log('Plugin '.a:bundle.name_spec)
|
||||
call s:log('$ '.cmd)
|
||||
call s:log('> '.out)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
func! vundle#scripts#all(bang, ...)
|
||||
let b:match = ''
|
||||
let info = ['"Keymap: i - Install bundle; c - Cleanup; s - Search; R - Reload list']
|
||||
let info = ['"Keymap: i - Install plugin; c - Cleanup; s - Search; R - Reload list']
|
||||
let matches = s:load_scripts(a:bang)
|
||||
if !empty(a:1)
|
||||
let matches = filter(matches, 'v:val =~? "'.escape(a:1,'"').'"')
|
||||
@@ -10,11 +10,11 @@ func! vundle#scripts#all(bang, ...)
|
||||
endif
|
||||
call vundle#scripts#view('search',info, vundle#scripts#bundle_names(reverse(matches)))
|
||||
redraw
|
||||
echo len(matches).' bundles found'
|
||||
echo len(matches).' plugins found'
|
||||
endf
|
||||
|
||||
func! vundle#scripts#reload() abort
|
||||
silent exec ':BundleSearch! '.(exists('b:match') ? b:match : '')
|
||||
silent exec ':PluginSearch! '.(exists('b:match') ? b:match : '')
|
||||
redraw
|
||||
endf
|
||||
|
||||
@@ -48,7 +48,7 @@ func! s:create_changelog() abort
|
||||
let updates = system(cmd)
|
||||
|
||||
call add(g:vundle_changelog, '')
|
||||
call add(g:vundle_changelog, 'Updated Bundle: '.bundle.name)
|
||||
call add(g:vundle_changelog, 'Updated Plugin: '.bundle.name)
|
||||
|
||||
if bundle.uri =~ "https://github.com"
|
||||
call add(g:vundle_changelog, 'Compare at: '.bundle.uri[0:-5].'/compare/'.initial_sha.'...'.updated_sha)
|
||||
@@ -75,7 +75,7 @@ func! s:view_changelog()
|
||||
endf
|
||||
|
||||
func! vundle#scripts#bundle_names(names)
|
||||
return map(copy(a:names), ' printf("Bundle ' ."'%s'".'", v:val) ')
|
||||
return map(copy(a:names), ' printf("Plugin ' ."'%s'".'", v:val) ')
|
||||
endf
|
||||
|
||||
func! vundle#scripts#view(title, headers, results)
|
||||
@@ -89,7 +89,7 @@ func! vundle#scripts#view(title, headers, results)
|
||||
|
||||
let g:vundle_view = bufnr('%')
|
||||
"
|
||||
" make buffer modifiable
|
||||
" make buffer modifiable
|
||||
" to append without errors
|
||||
set modifiable
|
||||
|
||||
@@ -99,24 +99,25 @@ func! vundle#scripts#view(title, headers, results)
|
||||
setl noswapfile
|
||||
|
||||
setl cursorline
|
||||
setl nonu ro noma ignorecase
|
||||
setl nonu ro noma
|
||||
if (exists('&relativenumber')) | setl norelativenumber | endif
|
||||
|
||||
setl ft=vundle
|
||||
setl syntax=vim
|
||||
syn keyword vimCommand Plugin
|
||||
syn keyword vimCommand Bundle
|
||||
syn keyword vimCommand Helptags
|
||||
|
||||
com! -buffer -bang -nargs=1 DeleteBundle
|
||||
com! -buffer -bang -nargs=1 DeletePlugin
|
||||
\ call vundle#installer#run('vundle#installer#delete', split(<q-args>,',')[0], ['!' == '<bang>', <args>])
|
||||
|
||||
com! -buffer -bang -nargs=? InstallAndRequireBundle
|
||||
com! -buffer -bang -nargs=? InstallAndRequirePlugin
|
||||
\ call vundle#installer#run('vundle#installer#install_and_require', split(<q-args>,',')[0], ['!' == '<bang>', <q-args>])
|
||||
|
||||
com! -buffer -bang -nargs=? InstallBundle
|
||||
com! -buffer -bang -nargs=? InstallPlugin
|
||||
\ call vundle#installer#run('vundle#installer#install', split(<q-args>,',')[0], ['!' == '<bang>', <q-args>])
|
||||
|
||||
com! -buffer -bang -nargs=0 InstallHelptags
|
||||
com! -buffer -bang -nargs=0 InstallHelptags
|
||||
\ call vundle#installer#run('vundle#installer#docs', 'helptags', [])
|
||||
|
||||
com! -buffer -nargs=0 VundleLog call s:view_log()
|
||||
@@ -127,10 +128,10 @@ func! vundle#scripts#view(title, headers, results)
|
||||
nnoremap <buffer> D :exec 'Delete'.getline('.')<CR>
|
||||
|
||||
nnoremap <buffer> add :exec 'Install'.getline('.')<CR>
|
||||
nnoremap <buffer> add! :exec 'Install'.substitute(getline('.'), '^Bundle ', 'Bundle! ', '')<CR>
|
||||
nnoremap <buffer> add! :exec 'Install'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '')<CR>
|
||||
|
||||
nnoremap <buffer> i :exec 'InstallAndRequire'.getline('.')<CR>
|
||||
nnoremap <buffer> I :exec 'InstallAndRequire'.substitute(getline('.'), '^Bundle ', 'Bundle! ', '')<CR>
|
||||
nnoremap <buffer> I :exec 'InstallAndRequire'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '')<CR>
|
||||
|
||||
nnoremap <buffer> l :VundleLog<CR>
|
||||
nnoremap <buffer> u :VundleChangelog<CR>
|
||||
@@ -140,7 +141,7 @@ func! vundle#scripts#view(title, headers, results)
|
||||
nnoremap <buffer> c :BundleClean<CR>
|
||||
nnoremap <buffer> C :BundleClean!<CR>
|
||||
|
||||
nnoremap <buffer> s :BundleSearch
|
||||
nnoremap <buffer> s :BundleSearch
|
||||
nnoremap <buffer> R :call vundle#scripts#reload()<CR>
|
||||
|
||||
" goto first line after headers
|
||||
@@ -159,7 +160,7 @@ func! s:fetch_scripts(to)
|
||||
elseif executable("wget")
|
||||
let temp = vundle#installer#shellesc(tempname())
|
||||
let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.vundle#installer#shellesc(a:to)
|
||||
if (has('win32') || has('win64'))
|
||||
if (has('win32') || has('win64'))
|
||||
let cmd = substitute(cmd, 'mv -f ', 'move /Y ', '') " change force flag
|
||||
let cmd = vundle#installer#shellesc(cmd)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user