Mercurial > dotfiles
comparison vim/autoload/ludo.vim @ 426:67f14a8c2304
Improve Vim configuration.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 28 Mar 2018 20:07:30 -0700 |
parents | d8086f81b9c8 |
children | 71a080d4d83c |
comparison
equal
deleted
inserted
replaced
425:350f7a55ff33 | 426:67f14a8c2304 |
---|---|
1 let g:ludo_trace = 0 | |
2 | |
3 " Debug logging. | |
4 function! ludo#trace(msg) abort | |
5 if g:ludo_trace | |
6 echom a:msg | |
7 endif | |
8 endfunction | |
9 | |
10 " Warning message. | |
11 function! ludo#warn(msg) abort | |
12 echohl WarningMsg | |
13 echomsg "ludo: Warning: ".a:msg | |
14 echohl None | |
15 endfunction | |
16 | |
17 " Error message. | |
18 function! ludo#error(msg) abort | |
19 echohl ErrorMsg | |
20 echomsg "ludo: Error: ".a:msg | |
21 echohl None | |
22 endfunction | |
23 | |
1 | 24 |
2 " Loads `pathogenrc` files in each bundle directory and, if found, | 25 " Loads `pathogenrc` files in each bundle directory and, if found, |
3 " builds an exclude list based on the glob patterns found in them. | 26 " builds an exclude list based on the glob patterns found in them. |
4 " | 27 " |
5 function! ludo#setup_pathogen(bundle_dirs) abort | 28 function! ludo#setup_pathogen(bundle_dirs) abort |
6 for bundle_dir in a:bundle_dirs | 29 for bundle_dir in a:bundle_dirs |
7 let l:rcfile = bundle_dir.'/pathogenrc' | 30 let l:rcfile = bundle_dir.'.pathogenrc' |
8 if !filereadable(l:rcfile) | 31 if !filereadable(l:rcfile) |
32 call ludo#trace("No bundle configuration file: ".l:rcfile) | |
9 continue | 33 continue |
10 endif | 34 endif |
11 | 35 |
12 let l:included = [] | 36 let l:included = [] |
13 let l:excluded = [] | 37 let l:excluded = [] |
38 call ludo#trace("Reading bundle configuration file: ".l:rcfile) | |
14 let l:rclines = readfile(l:rcfile) | 39 let l:rclines = readfile(l:rcfile) |
15 for line in l:rclines | 40 for line in l:rclines |
16 if line[0] == '#' | 41 if line[0] == '#' |
17 continue | 42 continue |
18 endif | 43 endif |
43 let l:excl_name = fnamemodify(excl, ':t') | 68 let l:excl_name = fnamemodify(excl, ':t') |
44 call add(g:pathogen_disabled, l:excl_name) | 69 call add(g:pathogen_disabled, l:excl_name) |
45 endif | 70 endif |
46 endfor | 71 endfor |
47 endfor | 72 endfor |
73 call ludo#trace("Exclude list: ".join(g:pathogen_disabled, ', ')) | |
48 endfunction | 74 endfunction |
49 | 75 |