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

Updated vim plugins

This commit is contained in:
amix
2017-07-06 14:57:35 +02:00
parent 48a2c325c3
commit 391f8b5c06
82 changed files with 2016 additions and 2757 deletions

View File

@ -265,12 +265,17 @@ function! syntastic#preprocess#perl(errors) abort " {{{2
endfunction " }}}2
function! syntastic#preprocess#prospector(errors) abort " {{{2
let errs = s:_decode_JSON(join(a:errors, ''))
let errs = join(a:errors, '')
if errs ==# ''
return []
endif
let json = s:_decode_JSON(errs)
let out = []
if type(errs) == type({}) && has_key(errs, 'messages')
if type(errs['messages']) == type([])
for e in errs['messages']
if type(json) == type({}) && has_key(json, 'messages')
if type(json['messages']) == type([])
for e in json['messages']
if type(e) == type({})
try
if e['source'] ==# 'pylint'
@ -300,6 +305,8 @@ function! syntastic#preprocess#prospector(errors) abort " {{{2
else
call syntastic#log#warn('checker python/prospector: unrecognized error format (crashed checker?)')
endif
else
call syntastic#log#warn('checker python/prospector: unrecognized error format (crashed checker?)')
endif
return out

View File

@ -76,7 +76,7 @@ function! syntastic#util#tmpdir() abort " {{{2
if (has('unix') || has('mac')) && executable('mktemp') && !has('win32unix')
" TODO: option "-t" to mktemp(1) is not portable
let tmp = $TMPDIR !=# '' ? $TMPDIR : $TMP !=# '' ? $TMP : '/tmp'
let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . getpid() . '-XXXXXXXX'), "\n")
let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . s:_fuzz() . '-XXXXXXXX'), "\n")
if v:shell_error == 0 && len(out) == 1
let tempdir = out[0]
endif
@ -84,13 +84,13 @@ function! syntastic#util#tmpdir() abort " {{{2
if tempdir ==# ''
if has('win32') || has('win64')
let tempdir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-' . getpid()
let tempdir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-' . s:_fuzz()
elseif has('win32unix')
let tempdir = syntastic#util#CygwinPath('/tmp/vim-syntastic-' . getpid())
let tempdir = syntastic#util#CygwinPath('/tmp/vim-syntastic-' . s:_fuzz())
elseif $TMPDIR !=# ''
let tempdir = $TMPDIR . '/vim-syntastic-' . getpid()
let tempdir = $TMPDIR . '/vim-syntastic-' . s:_fuzz()
else
let tempdir = '/tmp/vim-syntastic-' . getpid()
let tempdir = '/tmp/vim-syntastic-' . s:_fuzz()
endif
try
@ -401,9 +401,6 @@ function! syntastic#util#setLastTick(buf) abort " {{{2
call setbufvar(a:buf, 'syntastic_lasttick', getbufvar(a:buf, 'changedtick'))
endfunction " }}}2
let s:_wid_base = 'syntastic_' . getpid() . '_' . reltimestr(g:_SYNTASTIC_START) . '_'
let s:_wid_pool = 0
" Add unique IDs to windows
function! syntastic#util#setWids() abort " {{{2
for tab in range(1, tabpagenr('$'))
@ -614,8 +611,18 @@ endfunction "}}}2
let s:_getbufvar = function(v:version > 703 || (v:version == 703 && has('patch831')) ? 'getbufvar' : 's:_getbufvar_dumb')
lockvar s:_getbufvar
function! s:_fuzz_dumb() abort " {{{2
return 'tmp'
endfunction " }}}2
let s:_fuzz = function(exists('*getpid') ? 'getpid' : 's:_fuzz_dumb')
lockvar s:_fuzz
" }}}1
let s:_wid_base = 'syntastic_' . s:_fuzz() . '_' . reltimestr(g:_SYNTASTIC_START) . '_'
let s:_wid_pool = 0
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@ -1614,7 +1614,8 @@ SYNTAX CHECKERS FOR COFFEESCRIPT *syntastic-checkers-coffee*
The following checkers are available for CoffeeScript (filetype "coffee"):
1. Coffee...................|syntastic-coffee-coffee|
2. CoffeeLint...............|syntastic-coffee-coffeelint|
2. Coffee->JSHint...........|syntastic-coffee-coffee_jshint|
3. CoffeeLint...............|syntastic-coffee-coffeelint|
------------------------------------------------------------------------------
1. Coffee *syntastic-coffee-coffee*
@ -1634,7 +1635,28 @@ This checker is initialised using the "makeprgBuild()" function and thus it
accepts the standard options described at |syntastic-config-makeprg|.
------------------------------------------------------------------------------
2. CoffeeLint *syntastic-coffee-coffeelint*
2. Coffee->JSHint *syntastic-coffee-coffee_jshint*
Name: coffee_jshint
Maintainer: John Krauss <john@johnkrauss.com>
"Coffee->JSHint" is a JSHint validator for CoffeeScript. See the project's
page at GitHub for details:
https://github.com/marviq/coffee-jshint
Installation~
Install it with "npm": >
npm install -g coffee-jshint
<
Checker options~
This checker is initialised using the "makeprgBuild()" function and thus it
Accepts the standard options described at |syntastic-config-makeprg|.
------------------------------------------------------------------------------
3. CoffeeLint *syntastic-coffee-coffeelint*
Name: coffeelint
Maintainer: Lincoln Stoll <l@lds.li>

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START
endif
let g:_SYNTASTIC_VERSION = '3.8.0-55'
let g:_SYNTASTIC_VERSION = '3.8.0-60'
lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1

View File

@ -0,0 +1,44 @@
"============================================================================
"File: coffee_jshint.vim
"Description: Syntax checking plugin for syntastic
"Maintainer: John Krauss <john@johnkrauss.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_coffee_coffee_jshint_checker')
finish
endif
let g:loaded_syntastic_coffee_coffee_jshint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_coffee_coffee_jshint_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat =
\ '%Q-%\{32\,},' .
\ '%E%l:%c: %m,' .
\ '%P%f'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'returns': [0, 1] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'coffee',
\ 'exec': 'coffee-jshint',
\ 'name': 'coffee_jshint' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

View File

@ -33,6 +33,7 @@ function! SyntaxCheckers_css_csslint_GetLocList() dict
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['guards'],
\ 'defaults': {'bufnr': bufnr('')} })
endfunction

View File

@ -19,13 +19,13 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_lisp_clisp_GetLocList() dict
let buf = bufnr('')
let tmpdir = syntastic#util#tmpdir()
let out = tmpdir !=# '.' ? ('-o ' . syntastic#util#shescape(tmpdir . syntastic#util#Slash() . 'syntastic_' . getpid())) : ''
let makeprg = self.makeprgBuild({
\ 'args_after': '-q',
\ 'fname_before': '-c',
\ 'post_args_after': out })
\ 'post_args_after': ['-o', tmpdir] })
let errorformat =
\ '%-G;%.%#,' .
@ -40,7 +40,7 @@ function! SyntaxCheckers_lisp_clisp_GetLocList() dict
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr('')} })
\ 'defaults': {'bufnr': buf} })
call syntastic#util#rmrf(tmpdir)