diff options
author | Yuchen Ying | 2015-11-29 14:37:49 -0800 |
---|---|---|
committer | Yuchen Ying | 2015-11-29 14:37:49 -0800 |
commit | 12ef2ee68caf2151df9d3d22bfa39dacf44e0fb1 (patch) | |
tree | b5281ab07f04fb43545a26ba260d6c09de6b1b55 /syntax_checkers/beancount | |
parent | 31bb1394ba930cf1b7fb50d0e5869941ab18ac5d (diff) | |
download | vim-beancount-12ef2ee68caf2151df9d3d22bfa39dacf44e0fb1.tar.gz |
Add: syntax checker to be used by Syntastic
Integration doc:
https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide#7-external-checkers
Diffstat (limited to '')
-rw-r--r-- | syntax_checkers/beancount/bean_check.vim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/syntax_checkers/beancount/bean_check.vim b/syntax_checkers/beancount/bean_check.vim new file mode 100644 index 0000000..c3e5fce --- /dev/null +++ b/syntax_checkers/beancount/bean_check.vim @@ -0,0 +1,26 @@ +if exists('g:loaded_syntastic_beancount_bean_check') + finish +endif + +let g:loaded_syntastic_beancount_bean_check=1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_beancount_bean_check_IsAvailable() dict + return executable(self.getExec()) +endfunction + +function! SyntaxCheckers_beancount_bean_check_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + return SyntasticMake({ 'makeprg': makeprg }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'beancount', + \ 'name': 'bean_check', + \ 'exec': 'bean-check'}) + +let &cpo = s:save_cpo +unlet s:save_cpo |