# HG changeset patch # User Ludovic Chabant # Date 1522211665 25200 # Node ID d8086f81b9c8023fbadf605d799f3e17030474ca # Parent f2b1eae0432b2223e60d81847c750322423d7440 Pathogen config files. diff -r f2b1eae0432b -r d8086f81b9c8 vim/autoload/ludo.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/autoload/ludo.vim Tue Mar 27 21:34:25 2018 -0700 @@ -0,0 +1,49 @@ + +" Loads `pathogenrc` files in each bundle directory and, if found, +" builds an exclude list based on the glob patterns found in them. +" +function! ludo#setup_pathogen(bundle_dirs) abort + for bundle_dir in a:bundle_dirs + let l:rcfile = bundle_dir.'/pathogenrc' + if !filereadable(l:rcfile) + continue + endif + + let l:included = [] + let l:excluded = [] + let l:rclines = readfile(l:rcfile) + for line in l:rclines + if line[0] == '#' + continue + endif + + if line[0] == '-' + let l:excls = glob(bundle_dir.'/'.line[1:], 1, 1) + for excl in l:excls + let l:idx = index(l:included, excl) + if l:idx >= 0 + call remove(l:included, l:idx) + endif + call add(l:excluded, excl) + endfor + else + let l:incls = glob(bundle_dir.'/'.line, 1, 1) + for incl in l:incls + let l:idx = index(l:excluded, incl) + if l:idx >= 0 + call remove(l:excluded, l:idx) + endif + call add(l:included, incl) + endfor + endif + endfor + + for excl in l:excluded + if isdirectory(excl) + let l:excl_name = fnamemodify(excl, ':t') + call add(g:pathogen_disabled, l:excl_name) + endif + endfor + endfor +endfunction + diff -r f2b1eae0432b -r d8086f81b9c8 vim/bundle.pathogenrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/bundle.pathogenrc Tue Mar 27 21:34:25 2018 -0700 @@ -0,0 +1,10 @@ +-ag +-autotags +-ctrlp +-ctrlp-py-matcher +-haml +-interestingwords +-powerline +-ragtag +-twig +-vimroom diff -r f2b1eae0432b -r d8086f81b9c8 vim/local.pathogenrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/local.pathogenrc Tue Mar 27 21:34:25 2018 -0700 @@ -0,0 +1,5 @@ +-omnisharp-vim +-rtags +-vim-perforce +-vim-rtags +-vsremote diff -r f2b1eae0432b -r d8086f81b9c8 vim/vimrc --- a/vim/vimrc Tue Feb 20 22:11:58 2018 -0800 +++ b/vim/vimrc Tue Mar 27 21:34:25 2018 -0700 @@ -43,10 +43,7 @@ " Disable some plugins. let g:pathogen_disabled = get(g:, 'pathogen_disabled', []) -call add(g:pathogen_disabled, 'vimroom') -call add(g:pathogen_disabled, 'minibufexpl') -call add(g:pathogen_disabled, 'ragtag') -call add(g:pathogen_disabled, 'interestingwords') +call ludo#setup_pathogen([s:vim_home.'/bundle', s:vim_home.'/local']) " Load pathogen. runtime bundle/pathogen/autoload/pathogen.vim @@ -703,8 +700,9 @@ " FZF mappings. if s:HasPlugin('fzf') - nnoremap :Files - nnoremap :Buffers + nnoremap :Files + nnoremap :Buffers + nnoremap :History endif " }}}