mirror of
https://github.com/amix/vimrc
synced 2025-06-24 07:44:59 +08:00
Updated plugins
This commit is contained in:
@ -8,10 +8,11 @@
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" This syntax checker does not reformat your source code.
|
||||
" Use a BufWritePre autocommand to that end:
|
||||
" autocmd FileType go autocmd BufWritePre <buffer> Fmt
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_go_go_checker")
|
||||
finish
|
||||
@ -22,7 +23,7 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_go_IsAvailable() dict
|
||||
return executable('go') && executable('gofmt')
|
||||
return executable(self.getExec()) && executable('gofmt')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
@ -48,13 +49,17 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
|
||||
" Test files, i.e. files with a name ending in `_test.go`, are not
|
||||
" compiled by `go build`, therefore `go test` must be called for those.
|
||||
if match(expand('%'), '\m_test\.go$') == -1
|
||||
let makeprg = 'go build ' . syntastic#c#NullOutput()
|
||||
if match(expand('%', 1), '\m_test\.go$') == -1
|
||||
let cmd = 'build'
|
||||
let opts = syntastic#util#var('go_go_build_args')
|
||||
let cleanup = 0
|
||||
else
|
||||
let makeprg = 'go test -c ' . syntastic#c#NullOutput()
|
||||
let cmd = 'test -c'
|
||||
let opts = syntastic#util#var('go_go_test_args')
|
||||
let cleanup = 1
|
||||
endif
|
||||
let opt_str = (type(opts) != type('') || opts != '') ? join(syntastic#util#argsescape(opts)) : opts
|
||||
let makeprg = self.getExec() . ' ' . cmd . ' ' . opt_str . ' ' . syntastic#c#NullOutput()
|
||||
|
||||
" The first pattern is for warnings from C compilers.
|
||||
let errorformat =
|
||||
@ -71,11 +76,11 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
let errors = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h'),
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
|
||||
if cleanup
|
||||
call delete(expand('%:p:h') . syntastic#util#Slash() . expand('%:p:h:t') . '.test')
|
||||
call delete(expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:p:h:t', 1) . '.test')
|
||||
endif
|
||||
|
||||
return errors
|
||||
@ -88,4 +93,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:
|
||||
|
@ -8,10 +8,11 @@
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" This syntax checker does not reformat your source code.
|
||||
" Use a BufWritePre autocommand to that end:
|
||||
" autocmd FileType go autocmd BufWritePre <buffer> Fmt
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_go_gofmt_checker")
|
||||
finish
|
||||
@ -41,4 +42,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:
|
||||
|
@ -28,6 +28,7 @@ function! SyntaxCheckers_go_golint_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'type': 'w'},
|
||||
\ 'subtype': 'Style' })
|
||||
endfunction
|
||||
|
||||
@ -38,4 +39,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:
|
||||
|
@ -32,7 +32,7 @@ function! SyntaxCheckers_go_gotype_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h'),
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
endfunction
|
||||
|
||||
@ -43,4 +43,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:
|
||||
|
@ -19,11 +19,11 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_govet_IsAvailable() dict
|
||||
return executable('go')
|
||||
return executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_govet_GetLocList() dict
|
||||
let makeprg = 'go vet'
|
||||
let makeprg = self.getExec() . ' vet'
|
||||
|
||||
let errorformat =
|
||||
\ '%Evet: %.%\+: %f:%l:%c: %m,' .
|
||||
@ -37,15 +37,16 @@ function! SyntaxCheckers_go_govet_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h'),
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'defaults': {'type': 'w'} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'go',
|
||||
\ 'name': 'govet'})
|
||||
\ 'name': 'govet',
|
||||
\ 'exec': 'go' })
|
||||
|
||||
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:
|
||||
|
Reference in New Issue
Block a user