vim. ledger command can be changed

This commit is contained in:
Johann Klähn 2010-02-22 13:07:39 +01:00
parent eafc23bd4e
commit 020c3fb2b6

View file

@ -12,11 +12,20 @@ if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
if ! exists("g:ledger_bin") || ! executable(g:ledger_bin)
if executable('ledger')
let g:ledger_bin = 'ledger'
else
echoerr "ledger command not found. Set g:ledger_bin or extend $PATH."
finish
endif
endif
" %-G throws away blank lines, everything else is assumed to be part of a
" multi-line error message.
CompilerSet errorformat=%-G,%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:%.%#,%ZError:\ %m,%C%.%#
" unfortunately there is no 'check file' command,
" unfortunately there is no 'check file' command,
" so we will just use a query that returns no results. ever.
CompilerSet makeprg=ledger\ -f\ %\ reg\ not\ '.*'\ \>\ /dev/null
exe 'CompilerSet makeprg='.g:ledger_bin.'\ -f\ %\ reg\ not\ ''.*''\ \>\ /dev/null'