]> git.r.bdr.sh - rbdr/dotfiles/blob - vim/syntax_checkers/css.vim
99a16b86a36446f55948b3a26c1fc0c321689652
[rbdr/dotfiles] / vim / syntax_checkers / css.vim
1 "============================================================================
2 "File: css.vim
3 "Description: Syntax checking plugin for syntastic.vim using `csslint` CLI tool (http://csslint.net).
4 "Maintainer: Ory Band <oryband at gmail 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 if exists("loaded_css_syntax_checker")
12 finish
13 endif
14 let loaded_css_syntax_checker = 1
15
16 " Bail if the user doesn't have `csslint` installed.
17 if !executable("csslint")
18 finish
19 endif
20
21 function! SyntaxCheckers_css_GetLocList()
22 let makeprg = 'csslint --format=compact '.shellescape(expand('%'))
23
24 " Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
25 let errorformat = '%-G,%-G%f: lint free!,%f: line %l\, col %c\, %trror - %m,%f: line %l\, col %c\, %tarning - %m,%f: line %l\, col %c\, %m,'
26
27 return SyntasticMake({ 'makeprg': makeprg,
28 \ 'errorformat': errorformat,
29 \ 'defaults': {'bufnr': bufnr("")} })
30
31 endfunction