diff 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
line wrap: on
line diff
--- a/vim/autoload/ludo.vim	Wed Mar 28 20:07:21 2018 -0700
+++ b/vim/autoload/ludo.vim	Wed Mar 28 20:07:30 2018 -0700
@@ -1,16 +1,41 @@
+let g:ludo_trace = 0
+
+" Debug logging.
+function! ludo#trace(msg) abort
+    if g:ludo_trace
+        echom a:msg
+    endif
+endfunction
+
+" Warning message.
+function! ludo#warn(msg) abort
+    echohl WarningMsg
+    echomsg "ludo: Warning: ".a:msg
+    echohl None
+endfunction
+
+" Error message.
+function! ludo#error(msg) abort
+    echohl ErrorMsg
+    echomsg "ludo: Error: ".a:msg
+    echohl None
+endfunction
+
 
 " 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'
+        let l:rcfile = bundle_dir.'.pathogenrc'
         if !filereadable(l:rcfile)
+            call ludo#trace("No bundle configuration file: ".l:rcfile)
             continue
         endif
 
         let l:included = []
         let l:excluded = []
+        call ludo#trace("Reading bundle configuration file: ".l:rcfile)
         let l:rclines = readfile(l:rcfile)
         for line in l:rclines
             if line[0] == '#'
@@ -45,5 +70,6 @@
             endif
         endfor
     endfor
+    call ludo#trace("Exclude list: ".join(g:pathogen_disabled, ', '))
 endfunction