mirror of
https://github.com/amix/vimrc
synced 2025-06-24 07:44:59 +08:00
Updated plugins
This commit is contained in:
@ -0,0 +1,66 @@
|
||||
"============================================================================
|
||||
"File: snowcrash.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"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_apiblueprint_snowcrash_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_apiblueprint_snowcrash_checker = 1
|
||||
|
||||
if !exists('g:syntastic_apiblueprint_snowcrash_sort')
|
||||
let g:syntastic_apiblueprint_snowcrash_sort = 1
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_apiblueprint_snowcrash_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'post_args': '-u -l' })
|
||||
|
||||
let errorformat =
|
||||
\ '%trror: (%n) %m,' .
|
||||
\ '%tarning: (%n) %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr('')},
|
||||
\ 'returns': [0, 2] })
|
||||
|
||||
for e in loclist
|
||||
let matches = matchlist(e['text'], '\v^(.+); line (\d+), column (\d+) - line (\d+), column (\d+)$')
|
||||
if len(matches) > 5
|
||||
let e['lnum'] = str2nr(matches[2])
|
||||
let e['col'] = str2nr(matches[3])
|
||||
let e['vcol'] = 0
|
||||
|
||||
if matches[2] == matches[4]
|
||||
let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . matches[5] . 'c'
|
||||
endif
|
||||
|
||||
let e['text'] = matches[1]
|
||||
else
|
||||
let e['valid'] = 0
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'apiblueprint',
|
||||
\ 'name': 'snowcrash'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -28,7 +28,7 @@ function! SyntaxCheckers_bro_bro_IsAvailable() dict
|
||||
return 0
|
||||
endif
|
||||
|
||||
if system(self.getExecEscaped() . ' --help') !~# '--parse-only'
|
||||
if syntastic#util#system(self.getExecEscaped() . ' --help') !~# '--parse-only'
|
||||
call self.log('unknown option "--parse-only"')
|
||||
return 0
|
||||
endif
|
||||
|
@ -44,7 +44,9 @@ function! SyntaxCheckers_elixir_elixir_GetLocList() dict
|
||||
|
||||
let make_options['makeprg'] = self.makeprgBuild({ 'exe': compile_command })
|
||||
|
||||
let make_options['errorformat'] = '** %*[^\ ] %f:%l: %m'
|
||||
let make_options['errorformat'] =
|
||||
\ '%E** %*[^\ ] %f:%l: %m,' .
|
||||
\ '%W%f:%l: warning: %m'
|
||||
|
||||
return SyntasticMake(make_options)
|
||||
endfunction
|
||||
|
@ -30,10 +30,10 @@ function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict
|
||||
" know the version in order to know how to find out the version. :)
|
||||
|
||||
" Try "ghc-mod version".
|
||||
let ver = filter(split(system(self.getExecEscaped() . ' version'), '\n'), 'v:val =~# ''\m\sversion''')
|
||||
let ver = filter(split(syntastic#util#system(self.getExecEscaped() . ' version'), '\n'), 'v:val =~# ''\m\sversion''')
|
||||
if !len(ver)
|
||||
" That didn't work. Try "ghc-mod" alone.
|
||||
let ver = filter(split(system(self.getExecEscaped()), '\n'), 'v:val =~# ''\m\sversion''')
|
||||
let ver = filter(split(syntastic#util#system(self.getExecEscaped()), '\n'), 'v:val =~# ''\m\sversion''')
|
||||
endif
|
||||
|
||||
if len(ver)
|
||||
|
@ -46,7 +46,7 @@ function! SyntaxCheckers_java_checkstyle_GetLocList() dict
|
||||
let fname = syntastic#util#shescape( expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:t', 1) )
|
||||
|
||||
if has('win32unix')
|
||||
let fname = substitute(system('cygpath -m ' . fname), '\m\%x00', '', 'g')
|
||||
let fname = substitute(syntastic#util#system('cygpath -m ' . fname), '\m\%x00', '', 'g')
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
|
@ -129,7 +129,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
|
||||
|
||||
" load custom classpath {{{2
|
||||
if g:syntastic_java_javac_custom_classpath_command != ''
|
||||
let lines = system(g:syntastic_java_javac_custom_classpath_command)
|
||||
let lines = syntastic#util#system(g:syntastic_java_javac_custom_classpath_command)
|
||||
if syntastic#util#isRunningWindows() || has('win32unix')
|
||||
let lines = substitute(lines, "\r\n", "\n", 'g')
|
||||
endif
|
||||
@ -306,7 +306,7 @@ function! s:GetMavenProperties() " {{{2
|
||||
\ ' -f ' . syntastic#util#shescape(pom) .
|
||||
\ ' ' . g:syntastic_java_maven_options
|
||||
let mvn_is_managed_tag = 1
|
||||
let mvn_settings_output = split(system(mvn_cmd . ' help:effective-pom'), "\n")
|
||||
let mvn_settings_output = split(syntastic#util#system(mvn_cmd . ' help:effective-pom'), "\n")
|
||||
let current_path = 'project'
|
||||
for line in mvn_settings_output
|
||||
let matches = matchlist(line, '\m^\s*<\([a-zA-Z0-9\-\.]\+\)>\s*$')
|
||||
@ -340,7 +340,7 @@ function! s:GetMavenClasspath() " {{{2
|
||||
let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) .
|
||||
\ ' -f ' . syntastic#util#shescape(pom) .
|
||||
\ ' ' . g:syntastic_java_maven_options
|
||||
let mvn_classpath_output = split(system(mvn_cmd . ' dependency:build-classpath'), "\n")
|
||||
let mvn_classpath_output = split(syntastic#util#system(mvn_cmd . ' dependency:build-classpath'), "\n")
|
||||
let mvn_classpath = ''
|
||||
let class_path_next = 0
|
||||
|
||||
|
@ -23,7 +23,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_flow_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe_after': 'check',
|
||||
\ 'exe': self.getExecEscaped() . ' check',
|
||||
\ 'args_after': '--show-all-errors --json' })
|
||||
|
||||
let errorformat =
|
||||
|
@ -18,7 +18,7 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict
|
||||
let jsxhint_version = system(self.getExecEscaped() . ' --version')
|
||||
let jsxhint_version = syntastic#util#system(self.getExecEscaped() . ' --version')
|
||||
if v:shell_error || (jsxhint_version !~# '\m^JSXHint\>')
|
||||
return 0
|
||||
endif
|
||||
|
@ -51,17 +51,31 @@ function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " {{{1
|
||||
endif
|
||||
|
||||
let errorformat =
|
||||
\ '%AFile "%f"\, line %l\, characters %c-%*\d:,'.
|
||||
\ '%WWarning: File "%f"\, line %l\, chars %c-%n:,'.
|
||||
\ '%WWarning: line %l\, chars %c-%n:,'.
|
||||
\ '%AFile "%f"\, line %l\, characters %c-%n:,'.
|
||||
\ '%AFile "%f"\, line %l\, characters %c-%*\d (end at line %*\d\, character %*\d):,'.
|
||||
\ '%AFile "%f"\, line %l\, character %c:,'.
|
||||
\ '%AFile "%f"\, line %l\, character %c:%m,'.
|
||||
\ '%-GPreprocessing error %.%#,'.
|
||||
\ '%-GCommand exited %.%#,'.
|
||||
\ '%C%tarning %n: %m,'.
|
||||
\ '%C%tarning %*\d: %m,'.
|
||||
\ '%C%m,'.
|
||||
\ '%-G+%.%#'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
|
||||
for e in loclist
|
||||
if get(e, 'col', 0) && get(e, 'nr', 0)
|
||||
let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c'
|
||||
let e['nr'] = 0
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction " }}}1
|
||||
|
||||
" Utilities {{{1
|
||||
|
@ -46,7 +46,7 @@ function! SyntaxCheckers_perl_perl_IsAvailable() dict
|
||||
|
||||
" don't call executable() here, to allow things like
|
||||
" let g:syntastic_perl_interpreter='/usr/bin/env perl'
|
||||
silent! call system(self.getExecEscaped() . ' -e ' . syntastic#util#shescape('exit(0)'))
|
||||
silent! call syntastic#util#system(self.getExecEscaped() . ' -e ' . syntastic#util#shescape('exit(0)'))
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
|
||||
|
@ -32,7 +32,7 @@ function! SyntaxCheckers_python_pylint_IsAvailable() dict
|
||||
" On new-ish Fedora it's "python3-pylint 1.2.0".
|
||||
" Have you guys considered switching to creative writing yet? ;)
|
||||
|
||||
let pylint_version = filter( split(system(self.getExecEscaped() . ' --version'), '\m, \=\|\n'),
|
||||
let pylint_version = filter( split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\m, \=\|\n'),
|
||||
\ 'v:val =~# ''\m^\(python[-0-9]*-\|\.\)\=pylint[-0-9]*\>''' )[0]
|
||||
let ver = syntastic#util#parseVersion(substitute(pylint_version, '\v^\S+\s+', '', ''))
|
||||
call self.setVersion(ver)
|
||||
|
@ -38,7 +38,7 @@ function! SyntaxCheckers_r_lint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
call system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(lint)'))
|
||||
call syntastic#util#system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(lint)'))
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
|
||||
|
@ -41,7 +41,7 @@ function! SyntaxCheckers_r_svtools_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
call system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(svTools)'))
|
||||
call syntastic#util#system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(svTools)'))
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
|
||||
|
@ -20,8 +20,8 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_ruby_jruby_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': (syntastic#util#isRunningWindows() ? '-T1' : ''),
|
||||
\ 'args_after': '-W1 -c' })
|
||||
\ 'args': (syntastic#util#isRunningWindows() ? '-T1 -W1' : '-W1'),
|
||||
\ 'args_after': '-c' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-GSyntax OK for %f,'.
|
||||
|
@ -18,7 +18,9 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_ruby_macruby_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '-W1 -c' })
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '-W1',
|
||||
\ 'args_after': '-c' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-GSyntax OK,'.
|
||||
|
@ -36,7 +36,9 @@ function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i)
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_mri_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '-w -T1 -c' })
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '-w -T1',
|
||||
\ 'args_after': '-c' })
|
||||
|
||||
"this is a hack to filter out a repeated useless warning in rspec files
|
||||
"containing lines like
|
||||
|
@ -97,7 +97,7 @@ endfunction " }}}2
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'vim',
|
||||
\ 'name': 'vimlint',
|
||||
\ 'exec': 'vim' })
|
||||
\ 'exec': '' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
@ -29,7 +29,7 @@ function! SyntaxCheckers_yaml_yamlxs_IsAvailable() dict
|
||||
|
||||
" don't call executable() here, to allow things like
|
||||
" let g:syntastic_perl_interpreter='/usr/bin/env perl'
|
||||
silent! call system(self.getExecEscaped() . ' ' . s:Modules() . ' -e ' . syntastic#util#shescape('exit(0)'))
|
||||
silent! call syntastic#util#system(self.getExecEscaped() . ' ' . s:Modules() . ' -e ' . syntastic#util#shescape('exit(0)'))
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
|
||||
|
Reference in New Issue
Block a user