]> git.r.bdr.sh - rbdr/dotfiles/blame_incremental - vim/syntax_checkers/css.vim
Update the stuff
[rbdr/dotfiles] / vim / syntax_checkers / css.vim
... / ...
CommitLineData
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"============================================================================
11if exists("loaded_css_syntax_checker")
12 finish
13endif
14let loaded_css_syntax_checker = 1
15
16" Bail if the user doesn't have `csslint` installed.
17if !executable("csslint")
18 finish
19endif
20
21function! 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
31endfunction