ignore wildignore with expand/glob

- closes #110
This commit is contained in:
gmarik 2011-11-18 00:36:14 -06:00
parent baa3e989e0
commit 43080a1e5c
5 changed files with 18 additions and 13 deletions

View File

@ -36,7 +36,7 @@ endif
func! vundle#rc(...) abort
let g:bundle_dir = len(a:000) > 0 ? expand(a:1) : expand('$HOME/.vim/bundle')
let g:bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1)
let g:vundle_log = []
call vundle#config#init()
endf

View File

@ -69,17 +69,17 @@ func! s:rtp_add_a()
endf
func! s:rtp_rm(dir) abort
exec 'set rtp-='.fnameescape(expand(a:dir))
exec 'set rtp-='.fnameescape(expand(a:dir.'/after'))
exec 'set rtp-='.fnameescape(expand(a:dir, 1))
exec 'set rtp-='.fnameescape(expand(a:dir.'/after', 1))
endf
func! s:rtp_add(dir) abort
exec 'set rtp^='.fnameescape(expand(a:dir))
exec 'set rtp+='.fnameescape(expand(a:dir.'/after'))
exec 'set rtp^='.fnameescape(expand(a:dir, 1))
exec 'set rtp+='.fnameescape(expand(a:dir.'/after', 1))
endf
func! s:expand_path(path) abort
return simplify(expand(a:path))
return simplify(expand(a:path, 1))
endf
let s:bundle = {}

View File

@ -4,7 +4,7 @@ func! vundle#installer#new(bang, ...) abort
\ map(copy(a:000), 'vundle#config#init_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)], names + ['Helptags'])
call vundle#scripts#view('Installer',['" Installing bundles to '.expand(g:bundle_dir, 1)], names + ['Helptags'])
call s:process(a:bang, (a:bang ? 'add!' : 'add'))
@ -125,7 +125,7 @@ endf
func! vundle#installer#clean(bang) abort
let bundle_dirs = map(copy(g:bundles), 'v:val.path()')
let all_dirs = split(globpath(g:bundle_dir, '*'), "\n")
let all_dirs = split(globpath(g:bundle_dir, '*', 1), "\n")
let x_dirs = filter(all_dirs, '0 > index(bundle_dirs, v:val)')
if empty(x_dirs)
@ -178,7 +178,7 @@ endf
func! s:has_doc(rtp) abort
return isdirectory(a:rtp.'/doc')
\ && (!filereadable(a:rtp.'/doc/tags') || filewritable(a:rtp.'/doc/tags'))
\ && !(empty(glob(a:rtp.'/doc/*.txt')) && empty(glob(a:rtp.'/doc/*.??x')))
\ && !(empty(glob(a:rtp.'/doc/*.txt', 1)) && empty(glob(a:rtp.'/doc/*.??x', 1)))
endf
func! s:helptags(rtp) abort
@ -192,7 +192,7 @@ func! s:helptags(rtp) abort
endf
func! s:sync(bang, bundle) abort
let git_dir = expand(a:bundle.path().'/.git/')
let git_dir = expand(a:bundle.path().'/.git/', 1)
if isdirectory(git_dir)
if !(a:bang) | return 'todate' | endif
let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull'

View File

@ -105,7 +105,7 @@ func! vundle#scripts#view(title, headers, results)
endf
func! s:fetch_scripts(to)
let scripts_dir = fnamemodify(expand(a:to), ":h")
let scripts_dir = fnamemodify(expand(a:to, 1), ":h")
if !isdirectory(scripts_dir)
call mkdir(scripts_dir, "p")
endif
@ -134,7 +134,7 @@ func! s:fetch_scripts(to)
endf
func! s:load_scripts(bang)
let f = expand(g:bundle_dir.'/.vundle/script-names.vim-scripts.org.json')
let f = expand(g:bundle_dir.'/.vundle/script-names.vim-scripts.org.json', 1)
if a:bang || !filereadable(f)
if 0 != s:fetch_scripts(f)
return []

View File

@ -5,7 +5,7 @@ let root = '/tmp/vundle_bundles/'
let src = 'http://github.com/gmarik/vundle.git'
" let src = '~/.vim/bundle/vundle/.git'
if !isdirectory(expand(root).'/vundle')
if !isdirectory(expand(root, 1).'/vundle')
exec '!git clone '.src.' '.root.'/vundle'
endif
@ -56,6 +56,11 @@ filetype plugin indent on " Automatically detect file types.
set wildignore+=doc " should not break helptags
set wildignore+=.git " should not break clone
set wildignore+=.git/* " should not break clone
set wildignore+=*/.git/*
" TODO: helptags fails with this
" set wildignore+=doc/* " should not break clone
" set wildignore+=*/doc/*
" BundleInstall