summaryrefslogtreecommitdiff
path: root/contrib/vim/compiler/ledger.vim
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-03-04 13:41:35 -0500
committerJohn Wiegley <johnw@newartisans.com>2010-03-04 13:41:35 -0500
commit9143fbcdf13eb1d3601b37e8d8a3cdccacb90df1 (patch)
tree82c264de1672c7a3fa27d6934f869096817e78ee /contrib/vim/compiler/ledger.vim
parente5f4d54f14d8198a6eacddf38cc6ebdf5985bb06 (diff)
parent020c3fb2b64b8b59e509925e184d874b76b874de (diff)
downloadfork-ledger-9143fbcdf13eb1d3601b37e8d8a3cdccacb90df1.tar.gz
fork-ledger-9143fbcdf13eb1d3601b37e8d8a3cdccacb90df1.tar.bz2
fork-ledger-9143fbcdf13eb1d3601b37e8d8a3cdccacb90df1.zip
Merge remote branch 'kljohann/master' into next
Diffstat (limited to 'contrib/vim/compiler/ledger.vim')
-rw-r--r--contrib/vim/compiler/ledger.vim31
1 files changed, 31 insertions, 0 deletions
diff --git a/contrib/vim/compiler/ledger.vim b/contrib/vim/compiler/ledger.vim
new file mode 100644
index 00000000..33b019cb
--- /dev/null
+++ b/contrib/vim/compiler/ledger.vim
@@ -0,0 +1,31 @@
+" 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 <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,
+" so we will just use a query that returns no results. ever.
+exe 'CompilerSet makeprg='.g:ledger_bin.'\ -f\ %\ reg\ not\ ''.*''\ \>\ /dev/null'
+