mirror of
https://github.com/amix/vimrc
synced 2025-06-24 07:44:59 +08:00
Updated plugins
This commit is contained in:
@ -17,7 +17,6 @@ let g:loaded_syntastic_cpp_clang_check_checker = 1
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'clang_check',
|
||||
\ 'exec': 'clang-check',
|
||||
\ 'redirect': 'c/clang_check'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -17,7 +17,6 @@ let g:loaded_syntastic_cpp_clang_tidy_checker = 1
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'clang_tidy',
|
||||
\ 'exec': 'clang-tidy',
|
||||
\ 'redirect': 'c/clang_tidy'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -18,7 +18,6 @@ let g:loaded_syntastic_cpp_pc_lint_checker = 1
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'pc_lint',
|
||||
\ 'exec': 'lint-nt',
|
||||
\ 'redirect': 'c/pc_lint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -0,0 +1,53 @@
|
||||
"============================================================================
|
||||
"File: tern_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047@gmail.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_javascript_tern_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_tern_lint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_tern_lint_IsAvailable() dict
|
||||
return has('byte_offset') && executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_tern_lint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat = '%f:%t:%l:%c:%n:%m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'tern_lint',
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
if get(e, 'col', 0) && get(e, 'nr', 0)
|
||||
let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c'
|
||||
endif
|
||||
let e['nr'] = 0
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'name': 'tern_lint',
|
||||
\ 'exec': 'tern-lint' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -0,0 +1,51 @@
|
||||
"============================================================================
|
||||
"File: sass_lint.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_sass_sass_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_sass_sass_lint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_sass_sass_lint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [1, 5])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_sass_sass_lint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '-v',
|
||||
\ 'args_after': '-q -f compact' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f: line %l\, col %c\, %trror - %m,' .
|
||||
\ '%f: line %l\, col %c\, %tarning - %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'sass',
|
||||
\ 'name': 'sass_lint',
|
||||
\ 'exec': 'sass-lint' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -0,0 +1,23 @@
|
||||
"============================================================================
|
||||
"File: sass_lint.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_scss_sass_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_scss_sass_lint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'scss',
|
||||
\ 'name': 'sass_lint',
|
||||
\ 'redirect': 'sass/sass_lint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -41,35 +41,37 @@ endfunction " }}}1
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:GetValaModules() " {{{2
|
||||
if exists('g:syntastic_vala_modules')
|
||||
if type(g:syntastic_vala_modules) == type('')
|
||||
return split(g:syntastic_vala_modules, '\s\+')
|
||||
elseif type(g:syntastic_vala_modules) == type([])
|
||||
return copy(g:syntastic_vala_modules)
|
||||
if exists('g:syntastic_vala_modules') || exists('b:syntastic_vala_modules')
|
||||
let modules = syntastic#util#var('vala_modules')
|
||||
if type(modules) == type('')
|
||||
return split(modules, '\m\s\+')
|
||||
elseif type(modules) == type([])
|
||||
return copy(modules)
|
||||
else
|
||||
echoerr 'g:syntastic_vala_modules must be either list or string: fallback to in file modules string'
|
||||
echoerr 'syntastic_vala_modules must be either list or string: fallback to in file modules string'
|
||||
endif
|
||||
endif
|
||||
|
||||
let modules_line = search('^// modules: ', 'n')
|
||||
let modules_str = getline(modules_line)
|
||||
return split(strpart(modules_str, 12), '\s\+')
|
||||
return split(strpart(modules_str, 12), '\m\s\+')
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:GetValaVapiDirs() " {{{2
|
||||
if exists('g:syntastic_vala_vapi_dirs')
|
||||
if type(g:syntastic_vala_vapi_dirs) == type('')
|
||||
return split(g:syntastic_vala_vapi_dirs, '\s\+')
|
||||
elseif type(g:syntastic_vala_vapi_dirs) == type([])
|
||||
return copy(g:syntastic_vala_vapi_dirs)
|
||||
if exists('g:syntastic_vala_vapi_dirs') || exists('b:syntastic_vala_vapi_dirs')
|
||||
let vapi_dirs = syntastic#util#var('vala_vapi_dirs')
|
||||
if type(vapi_dirs) == type('')
|
||||
return split(vapi_dirs, '\m\s\+')
|
||||
elseif type(vapi_dirs) == type([])
|
||||
return copy(vapi_dirs)
|
||||
else
|
||||
echoerr 'g:syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string'
|
||||
echoerr 'syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string'
|
||||
endif
|
||||
endif
|
||||
|
||||
let vapi_line = search('^//\s*vapidirs:\s*','n')
|
||||
let vapi_str = getline(vapi_line)
|
||||
return split( substitute( vapi_str, '^//\s*vapidirs:\s*', '', 'g' ), '\s\+' )
|
||||
return split( substitute( vapi_str, '\m^//\s*vapidirs:\s*', '', 'g' ), '\m\s\+' )
|
||||
endfunction " }}}2
|
||||
|
||||
" }}}1
|
||||
|
@ -67,9 +67,10 @@ function! SyntaxCheckers_vim_vimlint_GetLocList() dict " {{{1
|
||||
\ 'EVL204': 3,
|
||||
\ 'EVL205': 3 }
|
||||
|
||||
if exists('g:syntastic_vimlint_options')
|
||||
if type(g:syntastic_vimlint_options) == type({})
|
||||
let options = filter(copy(g:syntastic_vimlint_options), 'v:key =~# "\\m^EVL"')
|
||||
if exists('g:syntastic_vimlint_options') || exists('b:syntastic_vimlint_options')
|
||||
let opts = syntastic#util#var('vimlint_options')
|
||||
if type(opts) == type({})
|
||||
let options = filter(copy(opts), 'v:key =~# "\\m^EVL"')
|
||||
call extend(param, options, 'force')
|
||||
endif
|
||||
endif
|
||||
|
Reference in New Issue
Block a user