mirror of
https://github.com/tpope/vim-pathogen.git
synced 2026-06-01 11:18:51 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 552e5f0bf8 | |||
| c8f5e6c63c | |||
| a50ad7c80e | |||
| 968e87ef7f | |||
| 52b091892c | |||
| 258c47fe06 | |||
| f4f79bc720 |
+17
-7
@@ -1,6 +1,6 @@
|
|||||||
" pathogen.vim - path option manipulation
|
" pathogen.vim - path option manipulation
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Version: 1.2
|
" Version: 1.3
|
||||||
|
|
||||||
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
|
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
|
||||||
"
|
"
|
||||||
@@ -81,12 +81,22 @@ function! pathogen#glob_directories(pattern) abort " {{{1
|
|||||||
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
|
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
|
||||||
endfunction "}}}1
|
endfunction "}}}1
|
||||||
|
|
||||||
" Prepend all subdirectories of path to the rtp, and append all after
|
" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if
|
||||||
|
" its 'basename()' is included in g:pathogen_disabled[]'.
|
||||||
|
function! pathogen#is_disabled(path) " {{{1
|
||||||
|
if !exists("g:pathogen_disabled")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
let sep = pathogen#separator()
|
||||||
|
return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1
|
||||||
|
endfunction "}}}1
|
||||||
|
|
||||||
|
" Prepend all subdirectories of path to the rtp, and append all 'after'
|
||||||
" directories in those subdirectories.
|
" directories in those subdirectories.
|
||||||
function! pathogen#runtime_prepend_subdirectories(path) " {{{1
|
function! pathogen#runtime_prepend_subdirectories(path) " {{{1
|
||||||
let sep = pathogen#separator()
|
let sep = pathogen#separator()
|
||||||
let before = pathogen#glob_directories(a:path.sep."*[^~]")
|
let before = filter(pathogen#glob_directories(a:path.sep."*[^~]"), '!pathogen#is_disabled(v:val)')
|
||||||
let after = pathogen#glob_directories(a:path.sep."*[^~]".sep."after")
|
let after = filter(pathogen#glob_directories(a:path.sep."*[^~]".sep."after"), '!pathogen#is_disabled(v:val[0:-7])')
|
||||||
let rtp = pathogen#split(&rtp)
|
let rtp = pathogen#split(&rtp)
|
||||||
let path = expand(a:path)
|
let path = expand(a:path)
|
||||||
call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
|
call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
|
||||||
@@ -108,9 +118,9 @@ function! pathogen#runtime_append_all_bundles(...) " {{{1
|
|||||||
let list = []
|
let list = []
|
||||||
for dir in pathogen#split(&rtp)
|
for dir in pathogen#split(&rtp)
|
||||||
if dir =~# '\<after$'
|
if dir =~# '\<after$'
|
||||||
let list += pathogen#glob_directories(substitute(dir,'after$',name.sep.'*[^~]'.sep.'after','')) + [dir]
|
let list += filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
|
||||||
else
|
else
|
||||||
let list += [dir] + pathogen#glob_directories(dir.sep.name.sep.'*[^~]')
|
let list += [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)')
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
let &rtp = pathogen#join(pathogen#uniq(list))
|
let &rtp = pathogen#join(pathogen#uniq(list))
|
||||||
@@ -123,7 +133,7 @@ let s:done_bundles = ''
|
|||||||
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
|
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
|
||||||
function! pathogen#helptags() " {{{1
|
function! pathogen#helptags() " {{{1
|
||||||
for dir in pathogen#split(&rtp)
|
for dir in pathogen#split(&rtp)
|
||||||
if dir[0 : strlen($VIM)-1] !=# $VIM && isdirectory(dir.'/doc') && (!filereadable(dir.'/doc/tags') || filewritable(dir.'/doc/tags'))
|
if dir[0 : strlen($VIM)-1] !=# $VIM && isdirectory(dir.'/doc') && !empty(glob(dir.'/doc/*')) && (!filereadable(dir.'/doc/tags') || filewritable(dir.'/doc/tags'))
|
||||||
helptags `=dir.'/doc'`
|
helptags `=dir.'/doc'`
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|||||||
Reference in New Issue
Block a user