aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--compiler/beancount.vim19
-rw-r--r--ftplugin/beancount.vim1
2 files changed, 20 insertions, 0 deletions
diff --git a/compiler/beancount.vim b/compiler/beancount.vim
new file mode 100644
index 0000000..5bcaa15
--- /dev/null
+++ b/compiler/beancount.vim
@@ -0,0 +1,19 @@
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "beancount"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+CompilerSet makeprg=bean-check\ %
+CompilerSet errorformat=%-G " Skip blank lines
+CompilerSet errorformat+=%f:%l:\ %m " File:line: message
+CompilerSet errorformat+=%-G\ %.%# " Skip indented lines.
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/ftplugin/beancount.vim b/ftplugin/beancount.vim
index 20c2058..2d603f9 100644
--- a/ftplugin/beancount.vim
+++ b/ftplugin/beancount.vim
@@ -10,6 +10,7 @@ let b:undo_ftplugin = "setlocal foldmethod< comments< commentstring<"
setl foldmethod=syntax
setl comments=b:;
setl commentstring=;%s
+compiler beancount
if !exists("g:beancount_separator_col")
let g:beancount_separator_col = 50