1
0
mirror of https://github.com/amix/vimrc synced 2025-07-21 11:54:59 +08:00
This commit is contained in:
huangqundl
2017-03-17 23:12:53 +08:00
parent 47b213d974
commit cba39b7326
855 changed files with 59981 additions and 35298 deletions

View File

@ -10,16 +10,14 @@
"
"============================================================================
if exists("g:loaded_syntastic_xhtml_jshint_checker")
if exists('g:loaded_syntastic_xhtml_jshint_checker')
finish
endif
let g:loaded_syntastic_xhtml_jshint_checker = 1
runtime! syntax_checkers/html/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xhtml',
\ 'name': 'jshint',
\ 'redirect': 'html/jshint'})
" vim: set et sts=4 sw=4:
" vim: set sw=4 sts=4 et fdm=marker:

View File

@ -0,0 +1,23 @@
"============================================================================
"File: proselint.vim
"Description: Syntax checking plugin for syntastic
"Maintainer: LCD 47 <lcd047 at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_xhtml_proselint_checker')
finish
endif
let g:loaded_syntastic_xhtml_proselint_checker = 1
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xhtml',
\ 'name': 'proselint',
\ 'redirect': 'text/proselint'})
" vim: set sw=4 sts=4 et fdm=marker:

View File

@ -9,23 +9,20 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
"
" Checker option:
"
" - g:syntastic_xhtml_tidy_ignore_errors (list; default: [])
" list of errors to ignore
if exists("g:loaded_syntastic_xhtml_tidy_checker")
if exists('g:loaded_syntastic_xhtml_tidy_checker')
finish
endif
let g:loaded_syntastic_xhtml_tidy_checker = 1
let s:save_cpo = &cpo
set cpo&vim
if !exists('g:syntastic_xhtml_tidy_ignore_errors')
let g:syntastic_xhtml_tidy_ignore_errors = []
endif
let s:save_cpo = &cpo
set cpo&vim
" Constants {{{1
" TODO: join this with html.vim DRY's sake?
function! s:TidyEncOptByFenc()
@ -46,16 +43,9 @@ function! s:TidyEncOptByFenc()
return get(TIDY_OPTS, &fileencoding, '-utf8')
endfunction
function! s:IgnoreError(text)
for item in g:syntastic_xhtml_tidy_ignore_errors
if stridx(a:text, item) != -1
return 1
endif
endfor
return 0
endfunction
" }}}1
function! SyntaxCheckers_xhtml_tidy_GetLocList() dict
function! SyntaxCheckers_xhtml_tidy_GetLocList() dict " {{{1
let encopt = s:TidyEncOptByFenc()
let makeprg = self.makeprgBuild({ 'args_after': encopt . ' -xml -e' })
@ -67,7 +57,7 @@ function! SyntaxCheckers_xhtml_tidy_GetLocList() dict
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr("")},
\ 'defaults': {'bufnr': bufnr('')},
\ 'returns': [0, 1, 2] })
for e in loclist
@ -77,7 +67,20 @@ function! SyntaxCheckers_xhtml_tidy_GetLocList() dict
endfor
return loclist
endfunction
endfunction " }}}1
" Utilities {{{1
function! s:IgnoreError(text) " {{{2
for item in g:syntastic_xhtml_tidy_ignore_errors
if stridx(a:text, item) != -1
return 1
endif
endfor
return 0
endfunction " }}}2
" }}}1
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xhtml',
@ -86,4 +89,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:
" vim: set sw=4 sts=4 et fdm=marker: