diff options
author | Johann Klähn <kljohann@gmail.com> | 2010-02-22 13:07:39 +0100 |
---|---|---|
committer | Johann Klähn <kljohann@gmail.com> | 2010-02-22 13:07:39 +0100 |
commit | 020c3fb2b64b8b59e509925e184d874b76b874de (patch) | |
tree | 5e5520d478eb7120de814847ad9b4482292df051 /contrib/vim/compiler | |
parent | eafc23bd4e40f00589cd1cd1b0d0cc70344accb7 (diff) | |
download | fork-ledger-020c3fb2b64b8b59e509925e184d874b76b874de.tar.gz fork-ledger-020c3fb2b64b8b59e509925e184d874b76b874de.tar.bz2 fork-ledger-020c3fb2b64b8b59e509925e184d874b76b874de.zip |
vim. ledger command can be changed
Diffstat (limited to 'contrib/vim/compiler')
-rw-r--r-- | contrib/vim/compiler/ledger.vim | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/contrib/vim/compiler/ledger.vim b/contrib/vim/compiler/ledger.vim index e8ea5ed0..33b019cb 100644 --- a/contrib/vim/compiler/ledger.vim +++ b/contrib/vim/compiler/ledger.vim @@ -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' |