From eafc23bd4e40f00589cd1cd1b0d0cc70344accb7 Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Sun, 21 Feb 2010 19:48:17 +0100 Subject: vim. Add quickfix support --- contrib/vim/compiler/ledger.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 contrib/vim/compiler/ledger.vim (limited to 'contrib/vim/compiler/ledger.vim') diff --git a/contrib/vim/compiler/ledger.vim b/contrib/vim/compiler/ledger.vim new file mode 100644 index 00000000..e8ea5ed0 --- /dev/null +++ b/contrib/vim/compiler/ledger.vim @@ -0,0 +1,22 @@ +" Vim Compiler File +" Compiler: ledger +" by Johann Klähn; Use according to the terms of the GPL>=2. +" vim:ts=2:sw=2:sts=2:foldmethod=marker + +if exists("current_compiler") + finish +endif +let current_compiler = "ledger" + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +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, +" so we will just use a query that returns no results. ever. +CompilerSet makeprg=ledger\ -f\ %\ reg\ not\ '.*'\ \>\ /dev/null + -- cgit v1.2.3 From 020c3fb2b64b8b59e509925e184d874b76b874de Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Mon, 22 Feb 2010 13:07:39 +0100 Subject: vim. ledger command can be changed --- contrib/vim/compiler/ledger.vim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'contrib/vim/compiler/ledger.vim') 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 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' -- cgit v1.2.3