diff options
author | Nathan Grigg | 2015-04-15 09:53:02 -0700 |
---|---|---|
committer | Nathan Grigg | 2015-04-15 09:53:02 -0700 |
commit | 7e143898c29b9c66fb5e1b12c2e4fe17cc782366 (patch) | |
tree | b1bcd0d48b3232ad95bad8a8ca20ead065fc971c | |
parent | 844101f686ef241e6835c85d78301da4cfb3f6db (diff) | |
download | vim-beancount-7e143898c29b9c66fb5e1b12c2e4fe17cc782366.tar.gz |
Add a beancount compiler that calls bean-check.
- Set the make program to bean-check.
- Set the errorformat to parse the output of bean-check.
Diffstat (limited to '')
-rw-r--r-- | compiler/beancount.vim | 19 | ||||
-rw-r--r-- | ftplugin/beancount.vim | 1 |
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 |