From afae51a1213caa58164389015469dba5381a1a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 6 Sep 2016 23:17:12 +0200 Subject: Various tweaks to configurations --- vim/autoload/pathogen.vim | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'vim/autoload/pathogen.vim') diff --git a/vim/autoload/pathogen.vim b/vim/autoload/pathogen.vim index a13ae08..59a75c1 100644 --- a/vim/autoload/pathogen.vim +++ b/vim/autoload/pathogen.vim @@ -1,6 +1,6 @@ " pathogen.vim - path option manipulation " Maintainer: Tim Pope -" Version: 2.3 +" Version: 2.4 " Install in ~/.vim/autoload (or ~\vimfiles\autoload). " @@ -90,27 +90,30 @@ function! pathogen#cycle_filetype() abort endfunction " Check if a bundle is disabled. A bundle is considered disabled if its -" basename or full name is included in the list g:pathogen_disabled. +" basename or full name is included in the list g:pathogen_blacklist or the +" comma delimited environment variable $VIMBLACKLIST. function! pathogen#is_disabled(path) abort if a:path =~# '\~$' return 1 endif let sep = pathogen#slash() - let blacklist = map( + let blacklist = \ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) + - \ pathogen#split($VIMBLACKLIST), - \ 'substitute(v:val, "[\\/]$", "", "")') + \ pathogen#split($VIMBLACKLIST) + if !empty(blacklist) + call map(blacklist, 'substitute(v:val, "[\\/]$", "", "")') + endif return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1 -endfunction "}}}1 +endfunction " Prepend the given directory to the runtime path and append its corresponding " after directory. Curly braces are expanded with pathogen#expand(). function! pathogen#surround(path) abort let sep = pathogen#slash() let rtp = pathogen#split(&rtp) - let path = fnamemodify(a:path, ':p:?[\\/]\=$??') + let path = fnamemodify(a:path, ':s?[\\/]\=$??') let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)') - let after = filter(reverse(pathogen#expand(path.sep.'after')), '!pathogen#is_disabled(v:val[0:-7])') + let after = filter(reverse(pathogen#expand(path, sep.'after')), '!pathogen#is_disabled(v:val[0:-7])') call filter(rtp, 'index(before + after, v:val) == -1') let &rtp = pathogen#join(before, rtp, after) return &rtp @@ -128,7 +131,7 @@ function! pathogen#interpose(name) abort let list = [] for dir in pathogen#split(&rtp) if dir =~# '\