]> git.r.bdr.sh - rbdr/dotfiles/blob - vim/syntax_checkers/zpt.vim
Merge branch 'master' of github.com:benbeltran/dotfiles
[rbdr/dotfiles] / vim / syntax_checkers / zpt.vim
1 "============================================================================
2 "File: zpt.vim
3 "Description: Syntax checking plugin for syntastic.vim
4 "Maintainer: claytron <robots at claytron dot com>
5 "License: This program is free software. It comes without any warranty,
6 " to the extent permitted by applicable law. You can redistribute
7 " it and/or modify it under the terms of the Do What The Fuck You
8 " Want To Public License, Version 2, as published by Sam Hocevar.
9 " See http://sam.zoy.org/wtfpl/COPYING for more details.
10 "
11 "============================================================================
12
13 " In order for this plugin to be useful, you will need to set up the
14 " zpt filetype in your vimrc
15 "
16 " " set up zope page templates as the zpt filetype
17 " au BufNewFile,BufRead *.pt,*.cpt,*.zpt set filetype=zpt syntax=xml
18 "
19 " Then install the zptlint program, found on pypi:
20 " http://pypi.python.org/pypi/zptlint
21
22 if exists("loaded_zpt_syntax_checker")
23 finish
24 endif
25 let loaded_zpt_syntax_checker = 1
26
27 " Bail if the user doesn't have zptlint installed
28 if !executable("zptlint")
29 finish
30 endif
31
32 function! SyntaxCheckers_zpt_GetLocList()
33 let makeprg="zptlint ".shellescape(expand('%'))
34 let errorformat='%-P*** Error in: %f,%Z%*\s\, at line %l\, column %c,%E%*\s%m,%-Q'
35 return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
36 endfunction