1
0
mirror of https://github.com/amix/vimrc synced 2025-08-08 06:45:00 +08:00

Updated vim plugins

This commit is contained in:
amix
2015-02-24 10:45:22 +00:00
parent 8fa0bd4574
commit d195ccb777
104 changed files with 1743 additions and 1464 deletions

View File

@ -146,7 +146,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
let fname = expand('%:p:h', 1) . syntastic#util#Slash() . expand ('%:t', 1)
if has('win32unix')
let fname = s:CygwinPath(fname)
let fname = syntastic#util#CygwinPath(fname)
endif
let makeprg = self.makeprgBuild({
@ -155,9 +155,9 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
" unashamedly stolen from *errorformat-javac* (quickfix.txt) and modified to include error types
let errorformat =
\ '%E%f:%l:\ error:\ %m,'.
\ '%W%f:%l:\ warning:\ %m,'.
\ '%A%f:%l:\ %m,'.
\ '%E%f:%l: error: %m,'.
\ '%W%f:%l: warning: %m,'.
\ '%A%f:%l: %m,'.
\ '%+Z%p^,'.
\ '%+C%.%#,'.
\ '%-G%.%#'
@ -179,10 +179,6 @@ endfunction " }}}1
" Utilities {{{1
function! s:CygwinPath(path) " {{{2
return substitute(system('cygpath -m ' . syntastic#util#shescape(a:path)), "\n", '', 'g')
endfunction " }}}2
function! s:RemoveCarriageReturn(line) " {{{2
return substitute(a:line, "\r", '', 'g')
endfunction " }}}2
@ -360,13 +356,14 @@ function! s:GetMavenClasspath() " {{{2
let mvn_properties = s:GetMavenProperties()
let output_dir = 'target/classes'
let sep = syntastic#util#Slash()
let output_dir = join(['target', 'classes'], sep)
if has_key(mvn_properties, 'project.build.outputDirectory')
let output_dir = mvn_properties['project.build.outputDirectory']
endif
let mvn_classpath = s:AddToClasspath(mvn_classpath, output_dir)
let test_output_dir = 'target/test-classes'
let test_output_dir = join(['target', 'test-classes'], sep)
if has_key(mvn_properties, 'project.build.testOutputDirectory')
let test_output_dir = mvn_properties['project.build.testOutputDirectory']
endif
@ -388,21 +385,23 @@ function! s:MavenOutputDirectory() " {{{2
if has_key(mvn_properties, 'project.properties.build.dir')
let output_dir = mvn_properties['project.properties.build.dir']
endif
if stridx(expand('%:p:h', 1), 'src.main.java') >= 0
let output_dir .= '/target/classes'
let sep = syntastic#util#Slash()
if stridx(expand('%:p:h', 1), join(['src', 'main', 'java'], sep)) >= 0
let output_dir = join ([output_dir, 'target', 'classes'], sep)
if has_key(mvn_properties, 'project.build.outputDirectory')
let output_dir = mvn_properties['project.build.outputDirectory']
endif
endif
if stridx(expand('%:p:h', 1), 'src.test.java') >= 0
let output_dir .= '/target/test-classes'
if stridx(expand('%:p:h', 1), join(['src', 'test', 'java'], sep)) >= 0
let output_dir = join([output_dir, 'target', 'test-classes'], sep)
if has_key(mvn_properties, 'project.build.testOutputDirectory')
let output_dir = mvn_properties['project.build.testOutputDirectory']
endif
endif
if has('win32unix')
let output_dir = s:CygwinPath(output_dir)
let output_dir = syntastic#util#CygwinPath(output_dir)
endif
return output_dir
endif

View File

@ -0,0 +1,47 @@
"============================================================================
"File: standard.vim
"Description: JavaScript syntax checker - using standard
"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_standard_checker")
finish
endif
let g:loaded_syntastic_javascript_standard_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_standard_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 6, 1])
endfunction
function! SyntaxCheckers_javascript_standard_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args': '-v' })
let errorformat = ' %f:%l:%c: %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'defaults': {'type': 'W'},
\ 'returns': [0, 1] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'javascript',
\ 'name': 'standard'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

View File

@ -22,7 +22,7 @@ function! SyntaxCheckers_json_jsonval_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat =
\ '%E%f:\ %m\ at\ line\ %l,' .
\ '%E%f: %m at line %l,' .
\ '%-G%.%#'
return SyntasticMake({

View File

@ -21,7 +21,7 @@ set cpo&vim
function! SyntaxCheckers_nasm_nasm_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_after': '-X gnu -f elf' .
\ ' -I ' . syntastic#util#shescape(expand('%:p:h', 1) . '/') .
\ ' -I ' . syntastic#util#shescape(expand('%:p:h', 1) . syntastic#util#Slash()) .
\ ' ' . syntastic#c#NullOutput() })
let errorformat = '%f:%l: %t%*[^:]: %m'

View File

@ -46,7 +46,7 @@ endfunction " }}}1
function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " {{{1
let makeprg = s:GetMakeprg()
if makeprg == ""
if makeprg == ''
return []
endif

View File

@ -44,7 +44,7 @@ function! SyntaxCheckers_python_flake8_GetLocList() dict
let e['text'] .= printf(' [%s%03d]', e['type'], e['nr'])
" E901 are syntax errors
" E902 are I/O errors
if e['type'] ==? 'E' && e['nr'] !~ '\m^9'
if e['type'] ==? 'E' && e['nr'] !~# '\m^9'
let e['subtype'] = 'Style'
endif
call remove(e, 'nr')

View File

@ -62,7 +62,7 @@ function! SyntaxCheckers_r_lint_GetLocList() dict
\ 'returns': [0] })
for e in loclist
if e['type'] == 'F'
if e['type'] ==? 'F'
" parse error
let e['type'] = 'E'
call remove(e, 'subtype')

View File

@ -26,7 +26,7 @@ function! SyntaxCheckers_ruby_reek_IsAvailable() dict
endfunction
function! SyntaxCheckers_ruby_reek_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_before': '--no-color --quiet --line-number --single-line' })
let makeprg = self.makeprgBuild({ 'args_before': '--no-color --line-number --single-line' })
let errorformat =
\ '%E%.%#: Racc::ParseError: %f:%l :: %m,' .
@ -34,7 +34,8 @@ function! SyntaxCheckers_ruby_reek_GetLocList() dict
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
\ 'errorformat': errorformat,
\ 'returns': [0, 2] })
for e in loclist
if e['type'] ==? 'W'

View File

@ -23,7 +23,9 @@ function! SyntaxCheckers_ruby_rubylint_GetLocList() dict
if !exists('s:rubylint_new')
let s:rubylint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2])
endif
let makeprg = self.makeprgBuild({ 'args': (s:rubylint_new ? '' : 'analyze ') . '--presenter=syntastic' })
let makeprg = self.makeprgBuild({
\ 'args': (s:rubylint_new ? '' : 'analyze '),
\ 'args_after': '--presenter=syntastic' })
let errorformat = '%f:%t:%l:%c: %m'

View File

@ -28,14 +28,14 @@ function! SyntaxCheckers_slim_slimrb_GetLocList() dict
if s:slimrb_new
let errorformat =
\ '%C\ %#%f\, Line %l\, Column %c,'.
\ '%-G\ %.%#,'.
\ '%C %#%f\, Line %l\, Column %c,'.
\ '%-G %.%#,'.
\ '%ESlim::Parser::SyntaxError: %m,'.
\ '%+C%.%#'
else
let errorformat =
\ '%C\ %#%f\, Line %l,'.
\ '%-G\ %.%#,'.
\ '%C %#%f\, Line %l,'.
\ '%-G %.%#,'.
\ '%ESlim::Parser::SyntaxError: %m,'.
\ '%+C%.%#'
endif

View File

@ -1,46 +1,45 @@
"============================================================================
"File: xcrun.vim
"Description: swift syntax checker - using xcrun
"Maintainer: Tom Fogg <tom@canobe.com>
"File: smlnj.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_swift_xcrun_checker")
if exists("g:loaded_syntastic_sml_smlnj_checker")
finish
endif
let g:loaded_syntastic_xcrun_checker = 1
let g:loaded_syntastic_sml_smlnj_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_swift_xcrun_GetLocList() dict
function! SyntaxCheckers_sml_smlnj_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({ 'args_after': 'swift' })
let errorformat=
\ '%f:%l:%c:{%*[^}]}: %trror: %m,'.
\ '%f:%l:%c:{%*[^}]}: fatal %trror: %m,'.
\ '%f:%l:%c:{%*[^}]}: %tarning: %m,'.
\ '%f:%l:%c: %trror: %m,'.
\ '%f:%l:%c: fatal %trror: %m,'.
\ '%f:%l:%c: %tarning: %m,'.
\ '%f:%l: %trror: %m,'.
\ '%f:%l: fatal %trror: %m,'.
\ '%f:%l: %tarning: %m,' .
let errorformat =
\ '%E%f:%l%\%.%c %trror: %m,' .
\ '%E%f:%l%\%.%c-%\d%\+%\%.%\d%\+ %trror: %m,' .
\ '%W%f:%l%\%.%c %tarning: %m,' .
\ '%W%f:%l%\%.%c-%\d%\+%\%.%\d%\+ %tarning: %m,' .
\ '%C%\s%\+%m,' .
\ '%-G%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
\ 'errorformat': errorformat,
\ 'postprocess': ['compressWhitespace'],
\ 'returns': [0, 1] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'swift',
\ 'name': 'xcrun'})
\ 'filetype': 'sml',
\ 'name': 'smlnj',
\ 'exec': 'sml'})
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@ -0,0 +1,55 @@
"============================================================================
"File: vint.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_vim_vint_checker")
finish
endif
let g:loaded_syntastic_vim_vint_checker = 1
if !exists('g:syntastic_vim_vint_sort')
let g:syntastic_vim_vint_sort = 1
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_vim_vint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'post_args': '--json' })
let errorformat = '%f:%l:%c:%t: %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'preprocess': 'vint',
\ 'returns': [0, 1] })
for e in loclist
if e['type'] ==? 's'
let e['type'] = 'w'
let e['subtype'] = 'Style'
elseif e['type'] !=? 'e' && e['type'] !=? 'w'
let e['type'] = 'e'
endif
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'vim',
\ 'name': 'vint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker: