1
0
mirror of https://github.com/amix/vimrc synced 2025-06-24 07:44:59 +08:00

Updated plugins. Added vim-golang as a mode

This commit is contained in:
amix
2014-03-11 21:10:50 +01:00
parent 2b82c75631
commit 8f0740e307
125 changed files with 4121 additions and 2440 deletions

View File

@ -1,7 +1,6 @@
"============================================================================
"File: syntastic.vim
"Description: Vim plugin for on the fly syntax checking.
"Version: 3.4.0-pre
"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
@ -19,6 +18,8 @@ if has('reltime')
let g:syntastic_start = reltime()
endif
let g:syntastic_version = '3.4.0'
" Sanity checks {{{1
for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands']
@ -286,6 +287,7 @@ function! s:CacheErrors(checker_names) " {{{2
if !s:skipFile()
" debug logging {{{3
call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'version')
call syntastic#log#debugShowOptions(g:SyntasticDebugTrace, s:debug_dump_options)
call syntastic#log#debugDump(g:SyntasticDebugVariables)
call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'aggregate_errors')
@ -303,17 +305,16 @@ function! s:CacheErrors(checker_names) " {{{2
let names = []
for checker in clist
let type = checker.getFiletype()
let name = checker.getName()
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . type . '/' . name)
let cname = checker.getFiletype() . '/' . checker.getName()
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . cname)
let loclist = checker.getLocList()
if !loclist.isEmpty()
if decorate_errors
call loclist.decorate(type, name)
call loclist.decorate(cname)
endif
call add(names, [type, name])
call add(names, cname)
let newLoclist = newLoclist.extend(loclist)
@ -325,13 +326,13 @@ function! s:CacheErrors(checker_names) " {{{2
" set names {{{3
if !empty(names)
if len(syntastic#util#unique(map( copy(names), 'v:val[0]' ))) == 1
let type = names[0][0]
let name = join(map(names, 'v:val[1]'), ', ')
if len(syntastic#util#unique(map( copy(names), 'substitute(v:val, "\\m/.*", "", "")' ))) == 1
let type = substitute(names[0], '\m/.*', '', '')
let name = join(map( names, 'substitute(v:val, "\\m.\\{-}/", "", "")' ), ', ')
call newLoclist.setName( name . ' ('. type . ')' )
else
" checkers from mixed types
call newLoclist.setName(join(map(names, 'v:val[0] . "/" . v:val[1]'), ', '))
call newLoclist.setName(join(names, ', '))
endif
endif
" }}}3
@ -416,13 +417,16 @@ function! SyntasticMake(options) " {{{2
call syntastic#log#debug(g:SyntasticDebugLoclist, 'checker output:', err_lines)
if has_key(a:options, 'preprocess')
if has_key(a:options, 'Preprocess')
let err_lines = call(a:options['Preprocess'], [err_lines])
call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess (external):', err_lines)
elseif has_key(a:options, 'preprocess')
let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines])
call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess:', err_lines)
endif
lgetexpr err_lines
let errors = copy(getloclist(0))
let errors = deepcopy(getloclist(0))
if has_key(a:options, 'cwd')
execute 'lcd ' . fnameescape(old_cwd)
@ -456,7 +460,12 @@ function! SyntasticMake(options) " {{{2
call s:addToErrors(errors, { 'subtype': a:options['subtype'] })
endif
if has_key(a:options, 'postprocess') && !empty(a:options['postprocess'])
if has_key(a:options, 'Postprocess') && !empty(a:options['Postprocess'])
for rule in a:options['Postprocess']
let errors = call(rule, [errors])
endfor
call syntastic#log#debug(g:SyntasticDebugLoclist, 'postprocess (external):', errors)
elseif has_key(a:options, 'postprocess') && !empty(a:options['postprocess'])
for rule in a:options['postprocess']
let errors = call('syntastic#postprocess#' . rule, [errors])
endfor

View File

@ -114,9 +114,9 @@ function! g:SyntasticLoclist.setName(name) " {{{2
let self._name = a:name
endfunction " }}}2
function! g:SyntasticLoclist.decorate(filetype, name) " {{{2
function! g:SyntasticLoclist.decorate(tag) " {{{2
for e in self._rawLoclist
let e['text'] .= ' [' . a:filetype . '/' . a:name . ']'
let e['text'] .= ' [' . a:tag . ']'
endfor
endfunction " }}}2

View File

@ -20,7 +20,7 @@ let s:defaultCheckers = {
\ 'coq': ['coqtop'],
\ 'cpp': ['gcc'],
\ 'cs': ['mcs'],
\ 'css': ['csslint', 'phpcs'],
\ 'css': ['csslint'],
\ 'cucumber': ['cucumber'],
\ 'cuda': ['nvcc'],
\ 'd': ['dmd'],
@ -54,7 +54,7 @@ let s:defaultCheckers = {
\ 'objc': ['gcc'],
\ 'objcpp': ['gcc'],
\ 'ocaml': ['camlp4o'],
\ 'perl': ['perl', 'perlcritic'],
\ 'perl': ['perlcritic'],
\ 'php': ['php', 'phpcs', 'phpmd'],
\ 'po': ['msgfmt'],
\ 'pod': ['podchecker'],
@ -142,14 +142,14 @@ function! g:SyntasticRegistry.getCheckers(ftalias, list) " {{{2
let ft = s:normaliseFiletype(a:ftalias)
call self._checkDeprecation(ft)
let ft_list =
let names =
\ !empty(a:list) ? a:list :
\ exists('b:syntastic_checkers') ? b:syntastic_checkers :
\ exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers :
\ get(s:defaultCheckers, ft, [])
\ get(s:defaultCheckers, ft, 0)
return !empty(ft_list) ?
\ self._filterCheckersByName(checkers_map, ft_list) : [checkers_map[keys(checkers_map)[0]]]
return type(names) == type([]) ?
\ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]]
endfunction " }}}2
function! g:SyntasticRegistry.getKnownFiletypes() " {{{2