diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/README | 6 | ||||
-rw-r--r-- | contrib/vim/syntax_checkers/gmid/gmid.vim | 36 |
2 files changed, 41 insertions, 1 deletions
diff --git a/contrib/README b/contrib/README index c57932c..ab45f9b 100644 --- a/contrib/README +++ b/contrib/README @@ -16,4 +16,8 @@ gmid.service vim Syntax highlighting of gmid configuration for vim, to be - placed into ~/.vim/ or /usr/share/vim/vimfiles. + placed into ~/.vim/ or /usr/share/vim/vimfiles/. + + To enable Syntastic checker, put this line in your vimrc: + + let g:syntastic_gmid_checkers = ['gmid'] diff --git a/contrib/vim/syntax_checkers/gmid/gmid.vim b/contrib/vim/syntax_checkers/gmid/gmid.vim new file mode 100644 index 0000000..d3187ee --- /dev/null +++ b/contrib/vim/syntax_checkers/gmid/gmid.vim @@ -0,0 +1,36 @@ +" Syntax checking plugin for syntastic +" Language: gmid(1) configuration file +" Licence: ISC + +if exists('g:loaded_syntastic_gmid_gmid_checker') + finish +endif +let g:loaded_syntastic_gmid_gmid_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_gmid_gmid_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '-nc' }) + + let errorformat = + \ '%-Gconfig OK,' . + \ '%f:%l %tarning: %m,' . + \ '%f:%l %trror: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'type': 'E'}, + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'gmid', + \ 'name': 'gmid', + \ 'exec': 'gmid'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: |