1
0
Fork 0
mirror of synced 2024-06-26 18:51:09 -04:00

Pulling upstream.

This commit is contained in:
Maksim Pecherskiy 2014-10-25 11:36:37 -07:00
commit 1c7abcd59e
166 changed files with 4472 additions and 1846 deletions

View file

@ -1,6 +1,6 @@
" pathogen.vim - path option manipulation
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 2.2
" Version: 2.3
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
"
@ -8,52 +8,49 @@
" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your
" .vimrc is the only other setup necessary.
"
" The API is documented inline below. For maximum ease of reading,
" :set foldmethod=marker
" The API is documented inline below.
if exists("g:loaded_pathogen") || &cp
finish
endif
let g:loaded_pathogen = 1
function! s:warn(msg)
echohl WarningMsg
echomsg a:msg
echohl NONE
endfunction
" Point of entry for basic default usage. Give a relative path to invoke
" pathogen#incubate() (defaults to "bundle/{}"), or an absolute path to invoke
" pathogen#surround(). For backwards compatibility purposes, a full path that
" does not end in {} or * is given to pathogen#runtime_prepend_subdirectories()
" instead.
function! pathogen#infect(...) abort " {{{1
for path in a:0 ? reverse(copy(a:000)) : ['bundle/{}']
if path =~# '^[^\\/]\+$'
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#incubate(path . '/{}')
elseif path =~# '^[^\\/]\+[\\/]\%({}\|\*\)$'
call pathogen#incubate(path)
elseif path =~# '[\\/]\%({}\|\*\)$'
" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke
" pathogen#surround(). Curly braces are expanded with pathogen#expand():
" "bundle/{}" finds all subdirectories inside "bundle" inside all directories
" in the runtime path.
function! pathogen#infect(...) abort
for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}']
if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]'
call pathogen#surround(path)
else
elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)'
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#surround(path . '/{}')
elseif path =~# '[{}*]'
call pathogen#interpose(path)
else
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#interpose(path . '/{}')
endif
endfor
call pathogen#cycle_filetype()
if pathogen#is_disabled($MYVIMRC)
return 'finish'
endif
return ''
endfunction " }}}1
endfunction
" Split a path into a list.
function! pathogen#split(path) abort " {{{1
function! pathogen#split(path) abort
if type(a:path) == type([]) | return a:path | endif
if empty(a:path) | return [] | endif
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
endfunction " }}}1
endfunction
" Convert a list to a path.
function! pathogen#join(...) abort " {{{1
function! pathogen#join(...) abort
if type(a:1) == type(1) && a:1
let i = 1
let space = ' '
@ -77,15 +74,143 @@ function! pathogen#join(...) abort " {{{1
let i += 1
endwhile
return substitute(path,'^,','','')
endfunction " }}}1
endfunction
" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
function! pathogen#legacyjoin(...) abort " {{{1
function! pathogen#legacyjoin(...) abort
return call('pathogen#join',[1] + a:000)
endfunction " }}}1
endfunction
" Turn filetype detection off and back on again if it was already enabled.
function! pathogen#cycle_filetype() abort
if exists('g:did_load_filetypes')
filetype off
filetype on
endif
endfunction
" Check if a bundle is disabled. A bundle is considered disabled if its
" basename or full name is included in the list g:pathogen_disabled.
function! pathogen#is_disabled(path) abort
if a:path =~# '\~$'
return 1
endif
let sep = pathogen#slash()
let blacklist = map(
\ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) +
\ pathogen#split($VIMBLACKLIST),
\ 'substitute(v:val, "[\\/]$", "", "")')
return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1
endfunction "}}}1
" Prepend the given directory to the runtime path and append its corresponding
" after directory. Curly braces are expanded with pathogen#expand().
function! pathogen#surround(path) abort
let sep = pathogen#slash()
let rtp = pathogen#split(&rtp)
let path = fnamemodify(a:path, ':p:?[\\/]\=$??')
let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)')
let after = filter(reverse(pathogen#expand(path.sep.'after')), '!pathogen#is_disabled(v:val[0:-7])')
call filter(rtp, 'index(before + after, v:val) == -1')
let &rtp = pathogen#join(before, rtp, after)
return &rtp
endfunction
" For each directory in the runtime path, add a second entry with the given
" argument appended. Curly braces are expanded with pathogen#expand().
function! pathogen#interpose(name) abort
let sep = pathogen#slash()
let name = a:name
if has_key(s:done_bundles, name)
return ""
endif
let s:done_bundles[name] = 1
let list = []
for dir in pathogen#split(&rtp)
if dir =~# '\<after$'
let list += reverse(filter(pathogen#expand(dir[0:-6].name.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir]
else
let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)')
endif
endfor
let &rtp = pathogen#join(pathogen#uniq(list))
return 1
endfunction
let s:done_bundles = {}
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
function! pathogen#helptags() abort
let sep = pathogen#slash()
for glob in pathogen#split(&rtp)
for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep')
if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags'))
silent! execute 'helptags' pathogen#fnameescape(dir)
endif
endfor
endfor
endfunction
command! -bar Helptags :call pathogen#helptags()
" Execute the given command. This is basically a backdoor for --remote-expr.
function! pathogen#execute(...) abort
for command in a:000
execute command
endfor
return ''
endfunction
" Section: Unofficial
function! pathogen#is_absolute(path) abort
return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]')
endfunction
" Given a string, returns all possible permutations of comma delimited braced
" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
" and globbed. Actual globs are preserved.
function! pathogen#expand(pattern) abort
if a:pattern =~# '{[^{}]\+}'
let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
let found = map(split(pat, ',', 1), 'pre.v:val.post')
let results = []
for pattern in found
call extend(results, pathogen#expand(pattern))
endfor
return results
elseif a:pattern =~# '{}'
let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)')
let post = a:pattern[strlen(pat) : -1]
return map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
else
return [a:pattern]
endif
endfunction
" \ on Windows unless shellslash is set, / everywhere else.
function! pathogen#slash() abort
return !exists("+shellslash") || &shellslash ? '/' : '\'
endfunction
function! pathogen#separator() abort
return pathogen#slash()
endfunction
" Convenience wrapper around glob() which returns a list.
function! pathogen#glob(pattern) abort
let files = split(glob(a:pattern),"\n")
return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")')
endfunction "}}}1
" Like pathogen#glob(), only limit the results to directories.
function! pathogen#glob_directories(pattern) abort
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
endfunction "}}}1
" Remove duplicates from a list.
function! pathogen#uniq(list) abort " {{{1
function! pathogen#uniq(list) abort
let i = 0
let seen = {}
while i < len(a:list)
@ -100,142 +225,18 @@ function! pathogen#uniq(list) abort " {{{1
endif
endwhile
return a:list
endfunction " }}}1
" \ on Windows unless shellslash is set, / everywhere else.
function! pathogen#separator() abort " {{{1
return !exists("+shellslash") || &shellslash ? '/' : '\'
endfunction " }}}1
" Convenience wrapper around glob() which returns a list.
function! pathogen#glob(pattern) abort " {{{1
let files = split(glob(a:pattern),"\n")
return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
endfunction "}}}1
" Like pathogen#glob(), only limit the results to directories.
function! pathogen#glob_directories(pattern) abort " {{{1
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
endfunction "}}}1
" Turn filetype detection off and back on again if it was already enabled.
function! pathogen#cycle_filetype() " {{{1
if exists('g:did_load_filetypes')
filetype off
filetype on
endif
endfunction " }}}1
" Check if a bundle is disabled. A bundle is considered disabled if it ends
" in a tilde or its basename or full name is included in the list
" g:pathogen_disabled.
function! pathogen#is_disabled(path) " {{{1
if a:path =~# '\~$'
return 1
elseif !exists("g:pathogen_disabled")
return 0
endif
let sep = pathogen#separator()
let blacklist = g:pathogen_disabled
return index(blacklist, strpart(a:path, strridx(a:path, sep)+1)) != -1 && index(blacklist, a:path) != 1
endfunction "}}}1
" Prepend the given directory to the runtime path and append its corresponding
" after directory. If the directory is already included, move it to the
" outermost position. Wildcards are added as is. Ending a path in /{} causes
" all subdirectories to be added (except those in g:pathogen_disabled).
function! pathogen#surround(path) abort " {{{1
let sep = pathogen#separator()
let rtp = pathogen#split(&rtp)
if a:path =~# '[\\/]{}$'
let path = fnamemodify(a:path[0:-4], ':p:s?[\\/]\=$??')
let before = filter(pathogen#glob_directories(path.sep.'*'), '!pathogen#is_disabled(v:val)')
let after = filter(reverse(pathogen#glob_directories(path.sep."*".sep."after")), '!pathogen#is_disabled(v:val[0:-7])')
call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
else
let path = fnamemodify(a:path, ':p:s?[\\/]\=$??')
let before = [path]
let after = [path . sep . 'after']
call filter(rtp, 'index(before + after, v:val) == -1')
endif
let &rtp = pathogen#join(before, rtp, after)
return &rtp
endfunction " }}}1
" Prepend all subdirectories of path to the rtp, and append all 'after'
" directories in those subdirectories. Deprecated.
function! pathogen#runtime_prepend_subdirectories(path) " {{{1
call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#surround('.string(a:path.'/{}').')')
return pathogen#surround(a:path . pathogen#separator() . '{}')
endfunction " }}}1
" For each directory in the runtime path, add a second entry with the given
" argument appended. If the argument ends in '/{}', add a separate entry for
" each subdirectory. The default argument is 'bundle/{}', which means that
" .vim/bundle/*, $VIM/vimfiles/bundle/*, $VIMRUNTIME/bundle/*,
" $VIM/vim/files/bundle/*/after, and .vim/bundle/*/after will be added (on
" UNIX).
function! pathogen#incubate(...) abort " {{{1
let sep = pathogen#separator()
let name = a:0 ? a:1 : 'bundle/{}'
if "\n".s:done_bundles =~# "\\M\n".name."\n"
return ""
endif
let s:done_bundles .= name . "\n"
let list = []
for dir in pathogen#split(&rtp)
if dir =~# '\<after$'
if name =~# '{}$'
let list += filter(pathogen#glob_directories(substitute(dir,'after$',name[0:-3],'').'*'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
else
let list += [dir, substitute(dir, 'after$', '', '') . name . sep . 'after']
endif
else
if name =~# '{}$'
let list += [dir] + filter(pathogen#glob_directories(dir.sep.name[0:-3].'*'), '!pathogen#is_disabled(v:val)')
else
let list += [dir . sep . name, dir]
endif
endif
endfor
let &rtp = pathogen#join(pathogen#uniq(list))
return 1
endfunction " }}}1
" Deprecated alias for pathogen#incubate().
function! pathogen#runtime_append_all_bundles(...) abort " {{{1
if a:0
call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#incubate('.string(a:1.'/{}').')')
else
call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#incubate()')
endif
return call('pathogen#incubate', map(copy(a:000),'v:val . "/{}"'))
endfunction
let s:done_bundles = ''
" }}}1
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
function! pathogen#helptags() abort " {{{1
let sep = pathogen#separator()
for glob in pathogen#split(&rtp)
for dir in split(glob(glob), "\n")
if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
silent! execute 'helptags' pathogen#fnameescape(dir.'/doc')
endif
endfor
endfor
endfunction " }}}1
command! -bar Helptags :call pathogen#helptags()
" Execute the given command. This is basically a backdoor for --remote-expr.
function! pathogen#execute(...) abort " {{{1
for command in a:000
execute command
endfor
return ''
endfunction " }}}1
" Backport of fnameescape().
function! pathogen#fnameescape(string) abort
if exists('*fnameescape')
return fnameescape(a:string)
elseif a:string ==# '-'
return '\-'
else
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
endif
endfunction
" Like findfile(), but hardcoded to use the runtimepath.
function! pathogen#runtime_findfile(file,count) abort "{{{1
@ -246,18 +247,38 @@ function! pathogen#runtime_findfile(file,count) abort "{{{1
else
return fnamemodify(file,':p')
endif
endfunction " }}}1
endfunction
" Backport of fnameescape().
function! pathogen#fnameescape(string) abort " {{{1
if exists('*fnameescape')
return fnameescape(a:string)
elseif a:string ==# '-'
return '\-'
" Section: Deprecated
function! s:warn(msg) abort
echohl WarningMsg
echomsg a:msg
echohl NONE
endfunction
" Prepend all subdirectories of path to the rtp, and append all 'after'
" directories in those subdirectories. Deprecated.
function! pathogen#runtime_prepend_subdirectories(path) abort
call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')')
return pathogen#surround(a:path . pathogen#slash() . '{}')
endfunction
function! pathogen#incubate(...) abort
let name = a:0 ? a:1 : 'bundle/{}'
call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')')
return pathogen#interpose(name)
endfunction
" Deprecated alias for pathogen#interpose().
function! pathogen#runtime_append_all_bundles(...) abort
if a:0
call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')')
else
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()')
endif
endfunction " }}}1
return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}')
endfunction
if exists(':Vedit')
finish
@ -265,7 +286,7 @@ endif
let s:vopen_warning = 0
function! s:find(count,cmd,file,lcd) " {{{1
function! s:find(count,cmd,file,lcd)
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
let file = pathogen#runtime_findfile(a:file,a:count)
if file ==# ''
@ -284,10 +305,10 @@ function! s:find(count,cmd,file,lcd) " {{{1
else
return a:cmd.' '.pathogen#fnameescape(file) . warning
endif
endfunction " }}}1
endfunction
function! s:Findcomplete(A,L,P) " {{{1
let sep = pathogen#separator()
function! s:Findcomplete(A,L,P)
let sep = pathogen#slash()
let cheats = {
\'a': 'autoload',
\'d': 'doc',
@ -312,7 +333,7 @@ function! s:Findcomplete(A,L,P) " {{{1
endfor
endfor
return sort(keys(found))
endfunction " }}}1
endfunction
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
@ -323,4 +344,4 @@ command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabed
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
" vim:set et sw=2:
" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':

View file

@ -64,7 +64,8 @@ function! s:setup_pad(bufnr, vert, size)
execute win . 'wincmd w'
execute (a:vert ? 'vertical ' : '') . 'resize ' . max([0, a:size])
augroup goyop
autocmd WinEnter,CursorMoved <buffer> call s:blank()
autocmd WinEnter,CursorMoved <buffer> nested call s:blank()
autocmd WinLeave <buffer> call s:hide_statusline()
augroup END
" To hide scrollbars of pad windows in GVim
@ -114,6 +115,10 @@ function! s:tranquilize()
endfor
endfunction
function! s:hide_statusline()
let &l:statusline = repeat(' ', winwidth(0))
endfunction
function! s:goyo_on(width)
let s:orig_tab = tabpagenr()
@ -131,7 +136,6 @@ function! s:goyo_on(width)
\ 'winwidth': &winwidth,
\ 'winminheight': &winminheight,
\ 'winheight': &winheight,
\ 'statusline': &statusline,
\ 'ruler': &ruler,
\ 'sidescroll': &sidescroll,
\ 'sidescrolloff': &sidescrolloff
@ -211,19 +215,20 @@ function! s:goyo_on(width)
call s:resize_pads()
call s:tranquilize()
let &statusline = repeat(' ', winwidth(0))
augroup goyo
autocmd!
autocmd BufWinLeave <buffer> call s:goyo_off()
autocmd TabLeave * call s:goyo_off()
autocmd VimResized * call s:resize_pads()
autocmd ColorScheme * call s:tranquilize()
autocmd WinEnter,WinLeave <buffer> call s:hide_statusline()
augroup END
call s:hide_statusline()
if exists('g:goyo_callbacks[0]')
call g:goyo_callbacks[0]()
endif
silent! doautocmd User GoyoEnter
endfunction
function! s:goyo_off()
@ -312,6 +317,7 @@ function! s:goyo_off()
if exists('g:goyo_callbacks[1]')
call g:goyo_callbacks[1]()
endif
silent! doautocmd User GoyoLeave
endfunction
function! s:goyo(bang, ...)

View file

@ -462,8 +462,8 @@ Jump to the previous sibling of the selected node.
------------------------------------------------------------------------------
*NERDTree-C*
Default key: C
Map option: NERDTreeMapChdir
Applies to: directories.
Map option: NERDTreeMapChangeRoot
Applies to: files and directories.
Make the selected directory node the new tree root. If a file is selected, its
parent is used.

View file

@ -39,12 +39,13 @@ Ada, AppleScript, Arduino, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C,
C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart,
DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go,
Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS,
Lex, Limbo, LISP, LLVM intermediate language, Lua, MATLAB, NASM, Objective-C,
Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X
and iOS property lists, Puppet, Python, Racket, R, reStructuredText, Ruby,
SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog,
VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope page templates, and zsh.
See the [wiki][3] for details about the corresponding supported checkers.
Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB, NASM,
Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable
Object, OS X and iOS property lists, Puppet, Python, R, Racket, Relax NG,
reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo,
Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML,
z80, Zope page templates, and zsh. See the [wiki][3] for details about the
corresponding supported checkers.
Below is a screenshot showing the methods that Syntastic uses to display syntax
errors. Note that, in practise, you will only have a subset of these methods
@ -127,6 +128,16 @@ error output for a syntax checker may have changed. In this case, make sure you
have the latest version of the syntax checker installed. If it still fails then
create an issue - or better yet, create a pull request.
<a name="faqpython3"></a>
__Q. The `python` checker complains about syntactically valid Python 3 constructs...__
A. Configure the `python` checker to call a Python 3 interpreter rather than
Python 2, e.g:
```vim
let g:syntastic_python_python_exec = '/path/to/python3'
```
<a name="faqperl"></a>
__Q. The `perl` checker has stopped working...__
@ -153,7 +164,8 @@ automatically by syntastic.
<a name="faqloclist"></a>
__Q. I run a checker and the location list is not updated...__
__Q. I run a checker and the location list is not updated...__
__Q. I run`:lopen` or `:lwindow` and the error window is empty...__
A. By default the location list is changed only when you run the `:Errors`
command, in order to minimise conflicts with other plugins. If you want the
@ -200,8 +212,7 @@ To tell syntastic to use `pylint`, you would use this setting:
let g:syntastic_python_checkers = ['pylint']
```
Some filetypes, like PHP, have style checkers as well as syntax checkers. These
can be chained together like this:
Checkers can be chained together like this:
```vim
let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd']
```
@ -219,12 +230,42 @@ e.g. to run `phpcs` and `phpmd`:
This works for any checkers available for the current filetype, even if they
aren't listed in `g:syntastic_<filetype>_checkers`. You can't run checkers for
"foreign" filetypes though (e.g. you can't run, say, a Python checker if the
current filetype is `php`).
filetype of the current file is `php`).
<a name="faqstyle"></a>
__Q. What is the difference between syntax checkers and style checkers?__
A. The errors and warnings they produce are highlighted differently and can
be filtered by different rules, but otherwise the distinction is pretty much
arbitrary. There is an ongoing effort to keep things consistent, so you can
_generally_ expect messages produced by syntax checkers to be _mostly_ related
to syntax, and messages produced by style checkers to be _mostly_ about style.
But there can be no formal guarantee that, say, a style checker that runs into
a syntax error wouldn't die with a fatal message, nor that a syntax checker
wouldn't give you warnings against using some constructs as being bad practice.
There is also no guarantee that messages marked as "style" are less severe than
the ones marked as "syntax" (whatever that might mean). And there are even a
few Frankenstein checkers (for example `flake8` and `pylama`) that, by their
nature, produce both kinds of messages. Syntastic is not smart enough to be
able to sort out these things by itself.
In fact it's more useful to look at this from the perspective of filtering
unwanted messages, rather than as an indicator of severity levels. The
distinction between syntax and style is orthogonal to the distinction between
errors and warnings, and thus you can turn off messages based on level, on
type, or both.
e.g. To disable all style messages:
```vim
let g:syntastic_quiet_messages = { "type": "style" }
```
See `:help syntastic_quiet_messages` for details.
<a name="faqaggregate"></a>
__Q. How can I display together the errors found by all checkers enabled for
the current file?__
__Q. I have enabled multiple checkers for the current filetype. How can I
display all of the errors from all of the checkers together?__
A. Set `g:syntastic_aggregate_errors` to 1 in your vimrc:
```vim
@ -238,29 +279,13 @@ See `:help syntastic-aggregating-errors` for more details.
__Q. How can I jump between the different errors without using the location
list at the bottom of the window?__
A. Vim provides several built in commands for this. See `:help :lnext` and
A. Vim provides several built-in commands for this. See `:help :lnext` and
`:help :lprev`.
If you use these commands a lot then you may want to add shortcut mappings to
your vimrc, or install something like [unimpaired][2], which provides such
mappings (among other things).
<a name="faqstyle"></a>
__Q. A syntax checker is giving me unwanted/strange style tips?__
A. Some filetypes (e.g. php) have style checkers as well as syntax
checkers. You can usually configure the options that are passed to the style
checkers, or just disable them. Take a look at the [wiki][3] to see what
options are available.
Alternatively, you can use `g:syntastic_quiet_messages` to filter out the
messages you don't want to see. e.g. To turn off all style messages:
```vim
let g:syntastic_quiet_messages = { "type": "style" }
```
See `:help syntastic_quiet_messages` for details.
<a name="faqbdelete"></a>
__Q. The error window is closed automatically when I :quit the current buffer
@ -303,3 +328,7 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9].
[10]: http://perldoc.perl.org/perlrun.html#*-c*
[11]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
[12]: https://github.com/rust-lang/rust/
<!--
vim:tw=79:sw=4:
-->

View file

@ -91,21 +91,21 @@ function! s:_init() " {{{2
let s:handlers = []
let s:cflags = {}
call s:_regHandler('\m\<cairo', 'syntastic#c#checkPKG', ['cairo', 'cairo'])
call s:_regHandler('\m\<freetype', 'syntastic#c#checkPKG', ['freetype', 'freetype2', 'freetype'])
call s:_regHandler('\m\<glade', 'syntastic#c#checkPKG', ['glade', 'libglade-2.0', 'libglade'])
call s:_regHandler('\m\<glib', 'syntastic#c#checkPKG', ['glib', 'glib-2.0', 'glib'])
call s:_regHandler('\m\<gtk', 'syntastic#c#checkPKG', ['gtk', 'gtk+-2.0', 'gtk+', 'glib-2.0', 'glib'])
call s:_regHandler('\m\<libsoup', 'syntastic#c#checkPKG', ['libsoup', 'libsoup-2.4', 'libsoup-2.2'])
call s:_regHandler('\m\<libxml', 'syntastic#c#checkPKG', ['libxml', 'libxml-2.0', 'libxml'])
call s:_regHandler('\m\<pango', 'syntastic#c#checkPKG', ['pango', 'pango'])
call s:_regHandler('\m\<SDL', 'syntastic#c#checkPKG', ['sdl', 'sdl'])
call s:_regHandler('\m\<opengl', 'syntastic#c#checkPKG', ['opengl', 'gl'])
call s:_regHandler('\m\<webkit', 'syntastic#c#checkPKG', ['webkit', 'webkit-1.0'])
call s:_regHandler('\m\<cairo', 's:_check_pkg', ['cairo', 'cairo'])
call s:_regHandler('\m\<freetype', 's:_check_pkg', ['freetype', 'freetype2', 'freetype'])
call s:_regHandler('\m\<glade', 's:_check_pkg', ['glade', 'libglade-2.0', 'libglade'])
call s:_regHandler('\m\<glib', 's:_check_pkg', ['glib', 'glib-2.0', 'glib'])
call s:_regHandler('\m\<gtk', 's:_check_pkg', ['gtk', 'gtk+-2.0', 'gtk+', 'glib-2.0', 'glib'])
call s:_regHandler('\m\<libsoup', 's:_check_pkg', ['libsoup', 'libsoup-2.4', 'libsoup-2.2'])
call s:_regHandler('\m\<libxml', 's:_check_pkg', ['libxml', 'libxml-2.0', 'libxml'])
call s:_regHandler('\m\<pango', 's:_check_pkg', ['pango', 'pango'])
call s:_regHandler('\m\<SDL', 's:_check_pkg', ['sdl', 'sdl'])
call s:_regHandler('\m\<opengl', 's:_check_pkg', ['opengl', 'gl'])
call s:_regHandler('\m\<webkit', 's:_check_pkg', ['webkit', 'webkit-1.0'])
call s:_regHandler('\m\<php\.h\>', 'syntastic#c#checkPHP', [])
call s:_regHandler('\m\<Python\.h\>', 'syntastic#c#checkPython', [])
call s:_regHandler('\m\<ruby', 'syntastic#c#checkRuby', [])
call s:_regHandler('\m\<php\.h\>', 's:_check_php', [])
call s:_regHandler('\m\<Python\.h\>', 's:_check_python', [])
call s:_regHandler('\m\<ruby', 's:_check_ruby', [])
endfunction " }}}2
" return a handler dictionary object
@ -253,7 +253,7 @@ endfunction " }}}2
" try to find library with 'pkg-config'
" search possible libraries from first to last given
" argument until one is found
function! syntastic#c#checkPKG(name, ...) " {{{2
function! s:_check_pkg(name, ...) " {{{2
if executable('pkg-config')
if !has_key(s:cflags, a:name)
for pkg in a:000
@ -274,7 +274,7 @@ function! syntastic#c#checkPKG(name, ...) " {{{2
endfunction " }}}2
" try to find PHP includes with 'php-config'
function! syntastic#c#checkPHP() " {{{2
function! s:_check_php() " {{{2
if executable('php-config')
if !has_key(s:cflags, 'php')
let s:cflags['php'] = system('php-config --includes')
@ -286,7 +286,7 @@ function! syntastic#c#checkPHP() " {{{2
endfunction " }}}2
" try to find the ruby headers with 'rbconfig'
function! syntastic#c#checkRuby() " {{{2
function! s:_check_ruby() " {{{2
if executable('ruby')
if !has_key(s:cflags, 'ruby')
let s:cflags['ruby'] = system('ruby -r rbconfig -e ' .
@ -300,7 +300,7 @@ function! syntastic#c#checkRuby() " {{{2
endfunction " }}}2
" try to find the python headers with distutils
function! syntastic#c#checkPython() " {{{2
function! s:_check_python() " {{{2
if executable('python')
if !has_key(s:cflags, 'python')
let s:cflags['python'] = system('python -c ''from distutils import ' .

View file

@ -46,6 +46,25 @@ function! syntastic#postprocess#filterForeignErrors(errors) " {{{2
return filter(copy(a:errors), 'get(v:val, "bufnr") == ' . bufnr(''))
endfunction " }}}2
" make sure line numbers are not past end of buffers
" XXX: this loads all referenced buffers in memory
function! syntastic#postprocess#guards(errors) " {{{2
let buffers = syntastic#util#unique(map(filter(copy(a:errors), 'v:val["valid"]'), 'str2nr(v:val["bufnr"])'))
let guards = {}
for b in buffers
let guards[b] = len(getbufline(b, 1, '$'))
endfor
for e in a:errors
if e['valid'] && e['lnum'] > guards[e['bufnr']]
let e['lnum'] = guards[e['bufnr']]
endif
endfor
return a:errors
endfunction " }}}2
" }}}1
let &cpo = s:save_cpo

View file

@ -24,6 +24,54 @@ function! syntastic#util#Slash() abort " {{{2
return (!exists("+shellslash") || &shellslash) ? '/' : '\'
endfunction " }}}2
" Create a temporary directory
function! syntastic#util#tmpdir() " {{{2
let tempdir = ''
if (has('unix') || has('mac')) && executable('mktemp')
" TODO: option "-t" to mktemp(1) is not portable
let tmp = $TMPDIR != '' ? $TMPDIR : $TMP != '' ? $TMP : '/tmp'
let out = split(system('mktemp -q -d ' . tmp . '/vim-syntastic-' . getpid() . '-XXXXXXXX'), "\n")
if v:shell_error == 0 && len(out) == 1
let tempdir = out[0]
endif
endif
if tempdir == ''
if has('win32') || has('win64')
let tempdir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-' . getpid()
elseif has('win32unix')
let tempdir = s:CygwinPath('/tmp/vim-syntastic-' . getpid())
elseif $TMPDIR != ''
let tempdir = $TMPDIR . '/vim-syntastic-' . getpid()
else
let tempdir = '/tmp/vim-syntastic-' . getpid()
endif
endif
return tempdir
endfunction " }}}2
" Recursively remove a directory
function! syntastic#util#rmrf(what) " {{{2
if getftype(a:what) ==# 'dir'
if !exists('s:rmrf')
let s:rmrf =
\ has('unix') || has('mac') ? 'rm -rf' :
\ has('win32') || has('win64') ? 'rmdir /S /Q' :
\ has('win16') || has('win95') || has('dos16') || has('dos32') ? 'deltree /Y' : ''
endif
if s:rmrf != ''
silent! call system(s:rmrf . ' ' . syntastic#util#shescape(a:what))
else
call s:_rmrf(a:what)
endif
else
silent! call delete(a:what)
endif
endfunction " }}}2
"search the first 5 lines of the file for a magic number and return a map
"containing the args and the executable
"
@ -278,6 +326,21 @@ function! s:_translateElement(key, term) " {{{2
return ret
endfunction " }}}2
function! s:_rmrf(what) " {{{2
if !exists('s:rmdir')
let s:rmdir = syntastic#util#shescape(get(g:, 'netrw_localrmdir', 'rmdir'))
endif
if getftype(a:what) ==# 'dir'
for f in split(globpath(a:what, '*'), "\n")
call s:_rmrf(f)
endfor
silent! call system(s:rmdir . ' ' . syntastic#util#shescape(a:what))
else
silent! call delete(a:what)
endif
endfunction " }}}2
" }}}1
let &cpo = s:save_cpo

View file

@ -67,7 +67,7 @@ Take a look at the wiki for a list of supported filetypes and checkers:
https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers
Note: This doc only deals with using syntastic. To learn how to write syntax
checker integrations, see the guide on the github wiki:
checker integrations, see the guide on the GitHub wiki:
https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
@ -78,16 +78,17 @@ Syntastic comes preconfigured with a default list of enabled checkers per
filetype. This list is kept reasonably short to prevent slowing down Vim or
trying to use conflicting checkers.
You can see the list checkers available for the current filetype with the
You can see the list of checkers available for the current filetype with the
|:SyntasticInfo| command.
If you want to override the configured list of checkers for a filetype then
see |syntastic-checker-options| for details. You can also change the arguments
passed to a specific checker as well.
You probably want to override the configured list of checkers for the
filetypes you use, and also change the arguments passed to specific checkers
to suit your needs. See |syntastic-checker-options| for details.
Use |:SyntasticCheck| to manually check right now. Use |:SyntasticToggleMode|
to switch between active (checking on writing the buffer) and passive (manual)
checking.
Use |:SyntasticCheck| to manually check right now. Use |:Errors| to open the
|location-list| window, and |:lclose| to close it. You can clear the error
list with |:SyntasticReset|, and you can use |:SyntasticToggleMode| to switch
between active (checking on writing the buffer) and passive (manual) checking.
==============================================================================
2. Functionality provided *syntastic-functionality*
@ -155,13 +156,21 @@ Example: >
highlight SyntasticErrorLine guibg=#2f0000
<
------------------------------------------------------------------------------
2.3. The error window *:Errors* *syntastic-error-window*
2.3. The error window *syntastic-error-window*
You can use the :Errors command to display the errors for the current buffer
You can use the |:Errors| command to display the errors for the current buffer
in the |location-list|.
Note that when you use :Errors, the current location list is overwritten with
Syntastic's own location list.
Note that when you use |:Errors|, the current location list is overwritten
with Syntastic's own location list.
By default syntastic doesn't fill the |location-list| with the errors found by
the checkers, in order to reduce clashes with other plugins. Consequently, if
you run |:lopen| or |:lwindow| rather than |:Errors| to open the error window you
wouldn't see syntastic's list of errors. If you insist on using |:lopen| or
|:lwindow| you should either run |:SyntasticSetLoclist| after running the checks,
or set |syntastic_always_populate_loc_list| which tells syntastic to update the
|location-list| automatically.
------------------------------------------------------------------------------
2.4. Error highlighting *syntastic-highlighting*
@ -212,11 +221,14 @@ See also: |'syntastic_<filetype>_<checker>_quiet_messages'|.
==============================================================================
3. Commands *syntastic-commands*
:Errors *:SyntasticErrors*
:Errors *:Errors*
When errors have been detected, use this command to pop up the |location-list|
and display the error messages.
Please note that the |:Errors| command overwrites the current location list with
syntastic's own location list.
:SyntasticToggleMode *:SyntasticToggleMode*
Toggles syntastic between active and passive mode. See |'syntastic_mode_map'|
@ -239,7 +251,7 @@ the order specified. The rules of |syntastic_aggregate_errors| still apply.
Example: >
:SyntasticCheck flake8 pylint
<
:SyntasticInfo *:SyntasticInfo*
:SyntasticInfo *:SyntasticInfo*
The command takes an optional argument, and outputs information about the
checkers available for the filetype named by said argument, or for the current
@ -420,7 +432,6 @@ default behaviour of running both checkers against the input file: >
Default: { "mode": "active",
"active_filetypes": [],
"passive_filetypes": [] }
Use this option to fine tune when automatic syntax checking is done (or not
done).
@ -449,7 +460,6 @@ active and passive modes.
*'syntastic_quiet_messages'*
Default: {}
Use this option to filter out some of the messages produced by checkers. The
option should be set to something like: >
let g:syntastic_quiet_messages = { "level": "warnings",
@ -518,6 +528,12 @@ statusline: >
<
If the buffer had 2 warnings, starting on line 5 then this would appear: >
[Warn: 5 #2]
<
*'b:syntastic_skip_checks'*
Default: unset
Only the local form |'b:syntastic_skip_checks'| is used. When set to a true
value, no checks are run against the corresponding buffer. Example: >
let b:syntastic_skip_checks = 1
<
*'syntastic_full_redraws'*
Default: 0 in GUI Vim and MacVim, 1 otherwise
@ -526,16 +542,24 @@ Changing it can in principle make screen redraws smoother, but it can also
cause screen to flicker, or cause ghost characters. Leaving it to the default
should be safe.
*'syntastic_exit_checks'*
Default: 0 when running under "cmd.exe" on Windows, 1 otherwise
Syntastic attempts to catch abnormal termination conditions from checkers by
looking at their exit codes. The "cmd.exe" shell on Windows make these checks
meaningless, by returning 1 to Vim when the checkers exit with non-zero codes.
The above variable can be used to disable exit code checks in syntastic.
*'syntastic_debug'*
Default: 0
Set this to the sum of one or more of the following flags to enable
debugging:
1 - trace checker calls
1 - trace general workflow
2 - dump location lists
4 - trace notifiers
8 - trace autocommands
16 - dump options
32 - trace running of specific checkers
Example: >
let g:syntastic_debug = 1
@ -593,11 +617,19 @@ Use |:SyntasticInfo| to see which checkers are available for a given filetype.
5.2 Choosing the executable *syntastic-config-exec*
*'syntastic_<filetype>_<checker>_exec'*
The executable used by a checker is normally defined automatically, when the
checkers is registered. You can however override it by setting the variable
The executable run by a checker is normally defined automatically, when the
checker is registered. You can however override it, by setting the variable
'g:syntastic_<filetype>_<checker>_exec': >
let g:syntastic_ruby_mri_exec = '~/bin/ruby2'
<
This variable has a local version, 'b:syntastic_<filetype>_<checker>_exec',
which takes precedence over the global one in the corresponding buffer.
*'b:syntastic_<checker>_exec'*
And there is also a local variable named 'b:syntastic_<checker>_exec', which
takes precedence over both 'b:syntastic_<filetype>_<checker>_exec' and
'g:syntastic_<filetype>_<checker>_exec' in the buffers where it is defined.
------------------------------------------------------------------------------
5.3 Configuring specific checkers *syntastic-config-makeprg*
@ -622,21 +654,20 @@ have local versions 'b:syntastic_<filetype>_<checker-name>_<option-name>',
which take precedence over the global ones in the corresponding buffers.
If one of these variables has a non-empty default and you want it to be empty,
you can set it to a space, e.g.: >
let g:syntastic_javascript_jslint_args = " "
you can set it to an empty string, e.g.: >
let g:syntastic_javascript_jslint_args = ""
<
(setting it to an empty string doesn't work, for implementation reasons).
*'syntastic_<filetype>_<checker>_exe'*
The 'exe' is normally the same as the 'exec' attribute described above, in
which case it may be omitted. However, you can use it to add environment
variables or additional parameters, e.g. to tell the mri checker to use KANJI
encoding you could do something like this: >
let g:syntastic_ruby_mri_exe = 'RUBYOPT="-Ke" ruby'
variables, or to change the way the checker is run. For example this setup
allows you to run PC-Lint under Wine emulation on Linux: >
let g:syntastic_c_pc_lint_exec = "wine"
let g:syntastic_c_pc_lint_exe = "wine c:/path/to/lint-nt.exe"
<
To override the args and the tail: >
let g:syntastic_ruby_mri_args = "--my --args --here"
let g:syntastic_ruby_mri_tail = "> /tmp/my-output-file-biatch"
let g:syntastic_c_pc_lint_args = "-w5 -Iz:/usr/include/linux"
let g:syntastic_c_pc_lint_tail = "2>/dev/null"
<
The general form of the override options is: >
syntastic_<filetype>_<checker>_<option-name>
@ -753,9 +784,9 @@ https://github.com/jmcantrell/vim-virtualenv). This is a limitation of
7. About *syntastic-about*
The core maintainers of syntastic are:
Martin Grenfell (github: scrooloose)
Gregor Uhlenheuer (github: kongo2002)
LCD 047 (github: lcd047)
Martin Grenfell (GitHub: scrooloose)
Gregor Uhlenheuer (GitHub: kongo2002)
LCD 047 (GitHub: lcd047)
Find the latest version of syntastic at:

View file

@ -19,12 +19,20 @@ if has('reltime')
lockvar! g:syntastic_start
endif
let g:syntastic_version = '3.4.0-117'
let g:syntastic_version = '3.5.0-65'
lockvar g:syntastic_version
" Sanity checks {{{1
for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'reltime', 'user_commands']
for s:feature in [
\ 'autocmd',
\ 'eval',
\ 'file_in_path',
\ 'modify_fname',
\ 'quickfix',
\ 'reltime',
\ 'user_commands'
\ ]
if !has(s:feature)
call syntastic#log#error("need Vim compiled with feature " . s:feature)
finish
@ -38,7 +46,7 @@ if !s:running_windows && executable('uname')
try
let s:uname = system('uname')
catch /\m^Vim\%((\a\+)\)\=:E484/
call syntastic#log#error("your shell " . &shell . " doesn't use traditional UNIX syntax for redirections")
call syntastic#log#error("your shell " . &shell . " can't handle traditional UNIX syntax for redirections")
finish
endtry
lockvar s:uname
@ -53,7 +61,7 @@ let g:syntastic_defaults = {
\ 'always_populate_loc_list': 0,
\ 'auto_jump': 0,
\ 'auto_loc_list': 2,
\ 'bash_hack': 1,
\ 'bash_hack': 0,
\ 'check_on_open': 0,
\ 'check_on_wq': 1,
\ 'cursor_columns': 1,
@ -63,6 +71,7 @@ let g:syntastic_defaults = {
\ 'enable_highlighting': 1,
\ 'enable_signs': 1,
\ 'error_symbol': '>>',
\ 'exit_checks': !(s:running_windows && &shell =~? '\m\<cmd\.exe$'),
\ 'filetype_map': {},
\ 'full_redraws': !(has('gui_running') || has('gui_macvim')),
\ 'id_checkers': 1,
@ -81,7 +90,7 @@ lockvar! g:syntastic_defaults
for s:key in keys(g:syntastic_defaults)
if !exists('g:syntastic_' . s:key)
let g:syntastic_{s:key} = g:syntastic_defaults[s:key]
let g:syntastic_{s:key} = copy(g:syntastic_defaults[s:key])
endif
endfor
@ -127,6 +136,8 @@ let g:SyntasticDebugAutocommands = 8
lockvar g:SyntasticDebugAutocommands
let g:SyntasticDebugVariables = 16
lockvar g:SyntasticDebugVariables
let g:SyntasticDebugCheckers = 32
lockvar g:SyntasticDebugCheckers
" }}}1
@ -229,7 +240,7 @@ endfunction " }}}2
function! s:QuitPreHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
let b:syntastic_skip_checks = !g:syntastic_check_on_wq
let b:syntastic_skip_checks = get(b:, 'syntastic_skip_checks', 0) || !syntastic#util#var('check_on_wq')
call SyntasticLoclistHide()
endfunction " }}}2
@ -388,7 +399,7 @@ endfunction " }}}2
function! s:ToggleMode() " {{{2
call s:modemap.toggleMode()
call s:ClearCache()
call s:UpdateErrors(1)
call s:notifiers.refresh(g:SyntasticLoclist.New([]))
call s:modemap.echoMode()
endfunction " }}}2
@ -420,7 +431,6 @@ function! SyntasticMake(options) " {{{2
call syntastic#log#debug(g:SyntasticDebugTrace, 'SyntasticMake: called with options:', a:options)
" save options and locale env variables {{{3
let old_shell = &shell
let old_shellredir = &shellredir
let old_local_errorformat = &l:errorformat
let old_errorformat = &errorformat
@ -482,13 +492,20 @@ function! SyntasticMake(options) " {{{2
execute 'lcd ' . fnameescape(old_cwd)
endif
silent! lolder
try
silent lolder
catch /\m^Vim\%((\a\+)\)\=:E380/
" E380: At bottom of quickfix stack
call setloclist(0, [], 'r')
catch /\m^Vim\%((\a\+)\)\=:E776/
" E776: No location list
" do nothing
endtry
" restore options {{{3
let &errorformat = old_errorformat
let &l:errorformat = old_local_errorformat
let &shellredir = old_shellredir
let &shell = old_shell
" }}}3
if !s:running_windows && (s:uname() =~ "FreeBSD" || s:uname() =~ "OpenBSD")
@ -497,7 +514,7 @@ function! SyntasticMake(options) " {{{2
call syntastic#log#debug(g:SyntasticDebugLoclist, 'raw loclist:', errors)
if has_key(a:options, 'returns') && index(a:options['returns'], v:shell_error) == -1
if syntastic#util#var('exit_checks') && has_key(a:options, 'returns') && index(a:options['returns'], v:shell_error) == -1
throw 'Syntastic: checker error'
endif
@ -556,9 +573,9 @@ endfunction " }}}2
" Skip running in special buffers
function! s:skipFile() " {{{2
let fname = expand('%')
let skip = (exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0) ||
\ (&buftype != '') || !filereadable(fname) || getwinvar(0, '&diff') ||
\ s:ignoreFile(fname) || fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions
let skip = get(b:, 'syntastic_skip_checks', 0) || (&buftype != '') ||
\ !filereadable(fname) || getwinvar(0, '&diff') || s:ignoreFile(fname) ||
\ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions
if skip
call syntastic#log#debug(g:SyntasticDebugTrace, 'skipFile: skipping')
endif
@ -578,22 +595,21 @@ function! s:addToErrors(errors, options) " {{{2
return a:errors
endfunction " }}}2
" The script changes &shellredir and &shell to stop the screen flicking when
" shelling out to syntax checkers. Not all OSs support the hacks though.
" XXX: Is this still needed?
" The script changes &shellredir to stop the screen
" flicking when shelling out to syntax checkers.
function! s:bashHack() " {{{2
if !exists('s:bash')
if !s:running_windows && (s:uname() !~# "FreeBSD") && (s:uname() !~# "OpenBSD")
let s:bash =
\ executable('/usr/local/bin/bash') ? '/usr/local/bin/bash' :
\ executable('/bin/bash') ? '/bin/bash' : ''
else
let s:bash = ''
if g:syntastic_bash_hack
if !exists('s:shell_is_bash')
let s:shell_is_bash =
\ !s:running_windows &&
\ (s:uname() !~# "FreeBSD") && (s:uname() !~# "OpenBSD") &&
\ &shell =~# '\m\<bash$'
endif
endif
if g:syntastic_bash_hack && s:bash != ''
let &shell = s:bash
let &shellredir = '&>'
if s:shell_is_bash
let &shellredir = '&>'
endif
endif
endfunction " }}}2

View file

@ -46,11 +46,9 @@ function! g:SyntasticChecker.getName() " {{{2
endfunction " }}}2
function! g:SyntasticChecker.getExec() " {{{2
if exists('g:syntastic_' . self._filetype . '_' . self._name . '_exec')
return expand(g:syntastic_{self._filetype}_{self._name}_exec)
endif
return self._exec
return
\ expand( exists('b:syntastic_' . self._name . '_exec') ? b:syntastic_{self._name}_exec :
\ syntastic#util#var(self._filetype . '_' . self._name . '_exec', self._exec) )
endfunction " }}}2
function! g:SyntasticChecker.getExecEscaped() " {{{2
@ -84,6 +82,15 @@ function! g:SyntasticChecker.setWantSort(val) " {{{2
let self._sort = a:val
endfunction " }}}2
function! g:SyntasticChecker.log(msg, ...) " {{{2
let leader = self._filetype . '/' . self._name . ': '
if a:0 > 0
call syntastic#log#debug(g:SyntasticDebugCheckers, leader . a:msg, a:1)
else
call syntastic#log#debug(g:SyntasticDebugCheckers, leader . a:msg)
endif
endfunction " }}}2
function! g:SyntasticChecker.makeprgBuild(opts) " {{{2
let basename = self._filetype . '_' . self._name . '_'
@ -147,10 +154,9 @@ function! g:SyntasticChecker._populateHighlightRegexes(errors) " {{{2
endfunction " }}}2
function! g:SyntasticChecker._getOpt(opts, basename, name, default) " {{{2
let user_val = syntastic#util#var(a:basename . a:name)
let ret = []
call extend( ret, self._shescape(get(a:opts, a:name . '_before', '')) )
call extend( ret, self._shescape(user_val != '' ? user_val : get(a:opts, a:name, a:default)) )
call extend( ret, self._shescape(syntastic#util#var( a:basename . a:name, get(a:opts, a:name, a:default) )) )
call extend( ret, self._shescape(get(a:opts, a:name . '_after', '')) )
return ret

View file

@ -99,7 +99,7 @@ function! s:_isSameIndex(line, old_line, column, idx, messages) " {{{2
return 1
endif
if a:messages[a:idx].scol <= a:column
if a:messages[a:idx].scol <= a:column || a:idx == 0
if a:idx == len(a:messages) - 1 || a:column < a:messages[a:idx + 1].scol
return 1
else

View file

@ -315,7 +315,7 @@ endfunction " }}}2
function! s:_setScreenColumn(item) " {{{2
if !has_key(a:item, 'scol')
let col = get(a:item, 'col', 0)
if col != 0 && a:item['vcol'] == 0
if col != 0 && get(a:item, 'vcol', 0) == 0
let buf = str2nr(a:item['bufnr'])
try
let line = getbufline(buf, a:item['lnum'])[0]

View file

@ -51,6 +51,7 @@ let s:defaultCheckers = {
\ 'lisp': ['clisp'],
\ 'llvm': ['llvm'],
\ 'lua': ['luac'],
\ 'markdown': ['mdl'],
\ 'matlab': ['mlint'],
\ 'nasm': ['nasm'],
\ 'nroff': ['mandoc'],
@ -65,6 +66,7 @@ let s:defaultCheckers = {
\ 'python': ['python', 'flake8', 'pylint'],
\ 'r': [],
\ 'racket': ['racket'],
\ 'rnc': ['rnv'],
\ 'rst': ['rst2pseudoxml'],
\ 'ruby': ['mri'],
\ 'sass': ['sass'],
@ -72,10 +74,11 @@ let s:defaultCheckers = {
\ 'scss': ['sass', 'scss_lint'],
\ 'sh': ['sh', 'shellcheck'],
\ 'slim': ['slimrb'],
\ 'spec': ['rpmlint'],
\ 'tcl': ['nagelfar'],
\ 'tex': ['lacheck', 'chktex'],
\ 'texinfo': ['makeinfo'],
\ 'text': ['atdtool'],
\ 'text': [],
\ 'twig': ['twiglint'],
\ 'typescript': ['tsc'],
\ 'vala': ['valac'],
@ -95,8 +98,13 @@ lockvar! s:defaultCheckers
let s:defaultFiletypeMap = {
\ 'gentoo-metadata': 'xml',
\ 'groff': 'nroff',
\ 'lhaskell': 'haskell',
\ 'litcoffee': 'coffee'
\ 'litcoffee': 'coffee',
\ 'mail': 'text',
\ 'mkd': 'markdown',
\ 'sgml': 'docbk',
\ 'sgmllnx': 'docbk',
\ }
lockvar! s:defaultFiletypeMap

View file

@ -18,15 +18,30 @@ let g:loaded_syntastic_bro_bro_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_bro_bro_GetHighlightRegex(item)
let term = matchstr(a:item['text'], '\m at or near "\zs[^"]\+\ze"')
return term != '' ? '\V\<' . escape(term, '\') . '\>' : ''
endfunction
function! SyntaxCheckers_bro_bro_IsAvailable() dict
return system(self.getExecEscaped() . ' --help') =~# '--parse-only'
if !executable(self.getExec())
return 0
endif
if system(self.getExecEscaped() . ' --help') !~# '--parse-only'
call self.log('unknown option "--parse-only"')
return 0
endif
return 1
endfunction
function! SyntaxCheckers_bro_bro_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_before': '--parse-only' })
"example: error in ./foo.bro, line 3: unknown identifier banana, at or "near "banana"
"example: error in ./foo.bro, line 3: unknown identifier banana, at or near "banana"
let errorformat =
\ 'fatal %trror in %f\, line %l: %m,' .
\ '%trror in %f\, line %l: %m,' .
\ '%tarning in %f\, line %l: %m'

View file

@ -18,18 +18,20 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_c_checkpatch_IsAvailable() dict
call syntastic#log#deprecationWarn('c_checker_checkpatch_location', 'c_checkpatch_exe')
call syntastic#log#deprecationWarn('c_checker_checkpatch_location', 'c_checkpatch_exec')
if !exists('g:syntastic_c_checkpatch_exe') && !executable(self.getExec())
if !exists('g:syntastic_c_checkpatch_exec') && !executable(self.getExec())
if executable('checkpatch')
let g:syntastic_c_checkpatch_exe = 'checkpatch'
let g:syntastic_c_checkpatch_exec = 'checkpatch'
elseif executable('./scripts/checkpatch.pl')
let g:syntastic_c_checkpatch_exe = fnamemodify('./scripts/checkpatch.pl', ':p')
let g:syntastic_c_checkpatch_exec = fnamemodify('./scripts/checkpatch.pl', ':p')
elseif executable('./scripts/checkpatch')
let g:syntastic_c_checkpatch_exe = fnamemodify('./scripts/checkpatch', ':p')
let g:syntastic_c_checkpatch_exec = fnamemodify('./scripts/checkpatch', ':p')
endif
endif
call self.log('exec =', self.getExec())
return executable(self.getExec())
endfunction

View file

@ -0,0 +1,61 @@
"============================================================================
"File: clang_check.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Benjamin Bannier <bbannier 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_c_clang_check_checker")
finish
endif
let g:loaded_syntastic_c_clang_check_checker = 1
if !exists('g:syntastic_clang_check_config_file')
let g:syntastic_clang_check_config_file = '.syntastic_clang_check_config'
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_c_clang_check_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'post_args':
\ '-- ' .
\ syntastic#c#ReadConfig(g:syntastic_clang_check_config_file) . ' ' .
\ '-fshow-column ' .
\ '-fshow-source-location ' .
\ '-fno-caret-diagnostics ' .
\ '-fno-color-diagnostics ' .
\ '-fdiagnostics-format=clang' })
let errorformat =
\ '%E%f:%l:%c: fatal error: %m,' .
\ '%E%f:%l:%c: error: %m,' .
\ '%W%f:%l:%c: warning: %m,' .
\ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
\ '%E%m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr('')},
\ 'returns': [0, 1] })
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'c',
\ 'name': 'clang_check',
\ 'exec': 'clang-check'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -0,0 +1,61 @@
"============================================================================
"File: clang_tidy.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Benjamin Bannier <bbannier 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_c_clang_tidy_checker")
finish
endif
let g:loaded_syntastic_c_clang_tidy_checker = 1
if !exists('g:syntastic_clang_tidy_config_file')
let g:syntastic_clang_tidy_config_file = '.syntastic_clang_tidy_config'
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_c_clang_tidy_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'post_args':
\ '-- ' .
\ syntastic#c#ReadConfig(g:syntastic_clang_tidy_config_file) . ' ' .
\ '-fshow-column ' .
\ '-fshow-source-location ' .
\ '-fno-caret-diagnostics ' .
\ '-fno-color-diagnostics ' .
\ '-fdiagnostics-format=clang' })
let errorformat =
\ '%E%f:%l:%c: fatal error: %m,' .
\ '%E%f:%l:%c: error: %m,' .
\ '%W%f:%l:%c: warning: %m,' .
\ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
\ '%E%m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr('')},
\ 'returns': [0, 1] })
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'c',
\ 'name': 'clang_tidy',
\ 'exec': 'clang-tidy'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -26,6 +26,7 @@ function! SyntaxCheckers_c_gcc_IsAvailable() dict
if !exists('g:syntastic_c_compiler')
let g:syntastic_c_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
endif
call self.log('g:syntastic_c_compiler =', g:syntastic_c_compiler)
return executable(expand(g:syntastic_c_compiler))
endfunction

View file

@ -30,15 +30,13 @@ set cpo&vim
function! SyntaxCheckers_c_oclint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'post_args_before': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file) })
\ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file) })
let errorformat =
\ '%E%f:%l:%c: %m P1 ,' .
\ '%E%f:%l:%c: %m P2 ,' .
\ '%W%f:%l:%c: %m P3 ,' .
\ '%E%f:%l:%c: fatal error: %m,' .
\ '%E%f:%l:%c: error: %m,' .
\ '%W%f:%l:%c: warning: %m,' .
\ '%E%f:%l:%c: %m,' .
\ '%-G%.%#'
let loclist = SyntasticMake({
@ -48,6 +46,15 @@ function! SyntaxCheckers_c_oclint_GetLocList() dict
\ 'postprocess': ['compressWhitespace'],
\ 'returns': [0, 3, 5] })
for e in loclist
if e['text'] =~# '\v P3( |$)'
let e['type'] = 'W'
endif
let e['text'] = substitute(e['text'], '\m\C P[1-3]$', '', '')
let e['text'] = substitute(e['text'], '\m\C P[1-3] ', ': ', '')
endfor
call self.setWantSort(1)
return loclist

View file

@ -0,0 +1,66 @@
"============================================================================
"File: pc_lint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Steve Bragg <steve at empresseffects 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_c_pc_lint_checker")
finish
endif
let g:loaded_syntastic_c_pc_lint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
if !exists('g:syntastic_pc_lint_config_file')
let g:syntastic_pc_lint_config_file = 'options.lnt'
endif
function! SyntaxCheckers_c_pc_lint_GetLocList() dict
let config = findfile(g:syntastic_pc_lint_config_file, '.;')
call self.log('config =', config)
" -hFs1 - show filename, add space after messages, try to make message 1 line
" -width(0,0) - make sure there are no line breaks
" -t - set tab size
" -v - turn off verbosity
let makeprg = self.makeprgBuild({
\ 'args': (filereadable(config) ? syntastic#util#shescape(fnamemodify(config, ':p')) : ''),
\ 'args_after': ['-hFs1', '-width(0,0)', '-t' . &tabstop, '-format=%f:%l:%C:%t:%n:%m'] })
let errorformat =
\ '%E%f:%l:%v:Error:%n:%m,' .
\ '%W%f:%l:%v:Warning:%n:%m,' .
\ '%I%f:%l:%v:Info:%n:%m,' .
\ '%-G%.%#'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['cygwinRemoveCR'] })
for e in loclist
if e['type'] ==? 'I'
let e['type'] = 'W'
let e['subtype'] = 'Style'
endif
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'c',
\ 'name': 'pc_lint',
\ 'exec': 'lint-nt'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -19,7 +19,7 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_co_coco_GetLocList() dict
let tmpdir = $TMPDIR != '' ? $TMPDIR : $TMP != '' ? $TMP : '/tmp'
let tmpdir = syntastic#util#tmpdir()
let makeprg = self.makeprgBuild({ 'args_after': '-c -o ' . tmpdir })
let errorformat =
@ -28,9 +28,13 @@ function! SyntaxCheckers_co_coco_GetLocList() dict
\ '%EFailed at: %f,'.
\ '%Z%trror: Parse error on line %l: %m'
return SyntasticMake({
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
call syntastic#util#rmrf(tmpdir)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({

View file

@ -27,6 +27,7 @@ function! SyntaxCheckers_cobol_cobc_IsAvailable() dict
if !exists('g:syntastic_cobol_compiler')
let g:syntastic_cobol_compiler = self.getExec()
endif
call self.log('g:syntastic_cobol_compiler =', g:syntastic_cobol_compiler)
return executable(expand(g:syntastic_cobol_compiler))
endfunction

View file

@ -22,9 +22,14 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_coffee_coffee_IsAvailable() dict
return executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull()), [1,6,2])
if !executable(self.getExec())
return 0
endif
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
call self.log(self.getExec() . ' version = ', ver)
return syntastic#util#versionIsAtLeast(ver, [1, 6, 2])
endfunction
function! SyntaxCheckers_coffee_coffee_GetLocList() dict

View file

@ -20,8 +20,9 @@ set cpo&vim
function! SyntaxCheckers_coffee_coffeelint_GetLocList() dict
if !exists('s:coffeelint_new')
let s:coffeelint_new = syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version'), [1, 4])
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', ver)
let s:coffeelint_new = syntastic#util#versionIsAtLeast(ver, [1, 4])
endif
let makeprg = self.makeprgBuild({ 'args_after': (s:coffeelint_new ? '--reporter csv' : '--csv') })

View file

@ -0,0 +1,25 @@
"============================================================================
"File: clang_check.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Benjamin Bannier <bbannier 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_cpp_clang_check_checker")
finish
endif
let g:loaded_syntastic_cpp_clang_check_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp',
\ 'name': 'clang_check',
\ 'exec': 'clang-check',
\ 'redirect': 'c/clang_check'})
" vim: set et sts=4 sw=4:

View file

@ -0,0 +1,25 @@
"============================================================================
"File: clang_tidy.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Benjamin Bannier <bbannier 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_cpp_clang_tidy_checker")
finish
endif
let g:loaded_syntastic_cpp_clang_tidy_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp',
\ 'name': 'clang_tidy',
\ 'exec': 'clang-tidy',
\ 'redirect': 'c/clang_tidy'})
" vim: set et sts=4 sw=4:

View file

@ -26,6 +26,7 @@ function! SyntaxCheckers_cpp_gcc_IsAvailable() dict
if !exists('g:syntastic_cpp_compiler')
let g:syntastic_cpp_compiler = executable(self.getExec()) ? self.getExec() : 'clang++'
endif
call self.log('g:syntastic_cpp_compiler =', g:syntastic_cpp_compiler)
return executable(expand(g:syntastic_cpp_compiler))
endfunction

View file

@ -0,0 +1,26 @@
"============================================================================
"File: pc_lint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Steve Bragg <steve at empresseffects 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_cpp_pc_lint_checker")
finish
endif
let g:loaded_syntastic_cpp_pc_lint_checker = 1
runtime! syntax_checkers/c/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp',
\ 'name': 'pc_lint',
\ 'exec': 'lint-nt',
\ 'redirect': 'c/pc_lint'})
" vim: set et sts=4 sw=4:

View file

@ -31,6 +31,7 @@ function! SyntaxCheckers_d_dmd_IsAvailable() dict
if !exists('g:syntastic_d_compiler')
let g:syntastic_d_compiler = self.getExec()
endif
call self.log('g:syntastic_d_compiler =', g:syntastic_d_compiler)
return executable(expand(g:syntastic_d_compiler))
endfunction

View file

@ -0,0 +1,55 @@
"============================================================================
"File: igor.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_docbk_igor_checker')
finish
endif
let g:loaded_syntastic_docbk_igor_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_docbk_igor_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat = '%f:%l:%m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': { 'type': 'W' },
\ 'subtype': 'Style',
\ 'returns': [0] })
let buf = bufnr('')
for e in loclist
" XXX: igor strips directories from filenames
let e['bufnr'] = buf
let e['hl'] = '\V' . escape( substitute(e['text'], '\m[^:]*:', '', ''), '\' )
let e['hl'] = substitute(e['hl'], '\V[', '\\zs', 'g')
let e['hl'] = substitute(e['hl'], '\V]', '\\ze', 'g')
" let e['text'] = substitute(e['text'], '\m:.*$', '', '')
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'docbk',
\ 'name': 'igor'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -20,6 +20,9 @@ set cpo&vim
" TODO: we should probably split this into separate checkers
function! SyntaxCheckers_elixir_elixir_IsAvailable() dict
call self.log(g:SyntasticDebugCheckers,
\ 'executable("elixir") = ' . executable('elixir') . ', ' .
\ 'executable("mix") = ' . executable('mix'))
return executable('elixir') && executable('mix')
endfunction

View file

@ -32,7 +32,7 @@ main([FileName, "-rebar", Path, LibDirs]) ->
%io:format("~p~n", [LibDirs1]),
compile(FileName, LibDirs1);
main([FileName, LibDirs]) ->
main([FileName | LibDirs]) ->
compile(FileName, LibDirs).
compile(FileName, LibDirs) ->
@ -45,7 +45,12 @@ compile(FileName, LibDirs) ->
warn_export_vars,
strong_validation,
report] ++
[{i, filename:join(Root, I)} || I <- LibDirs]).
[{i, filename:join(Root, I)} || I <- LibDirs] ++
case lists:member("deps/pmod_transform/include", LibDirs) of
true -> [{parse_transform, pmod_pt}];
_ -> []
end
).
get_root(Dir) ->
Path = filename:split(filename:absname(Dir)),

View file

@ -21,6 +21,7 @@ set cpo&vim
function! SyntaxCheckers_eruby_ruby_IsAvailable() dict
if !exists('g:syntastic_eruby_ruby_exec') && exists('g:syntastic_ruby_exec')
let g:syntastic_eruby_ruby_exec = g:syntastic_ruby_exec
call self.log('g:syntastic_eruby_ruby_exec =', g:syntastic_eruby_ruby_exec)
endif
return executable(self.getExec())
endfunction
@ -42,9 +43,16 @@ function! SyntaxCheckers_eruby_ruby_GetLocList() dict
\ syntastic#util#shescape('puts ERB.new(File.read(' .
\ fname . encoding_spec .
\ ').gsub(''<%='',''<%''), nil, ''-'').src') .
\ ' | ' . self.getExecEscaped() . ' -c'
\ ' | ' . self.getExecEscaped() . ' -w -c'
let errorformat =
let errorformat = '%-G%\m%.%#warning: %\%%(possibly %\)%\?useless use of a literal in void context,'
" filter out lines starting with ...
" long lines are truncated and wrapped in ... %p then returns the wrong
" column offset
let errorformat .= '%-G%\%.%\%.%\%.%.%#,'
let errorformat .=
\ '%-GSyntax OK,'.
\ '%E-:%l: syntax error\, %m,%Z%p^,'.
\ '%W-:%l: warning: %m,'.

View file

@ -26,6 +26,7 @@ function! SyntaxCheckers_fortran_gfortran_IsAvailable() dict
if !exists('g:syntastic_fortran_compiler')
let g:syntastic_fortran_compiler = self.getExec()
endif
call self.log('g:syntastic_fortran_compiler = ', g:syntastic_fortran_compiler)
return executable(expand(g:syntastic_fortran_compiler))
endfunction

View file

@ -21,7 +21,9 @@ set cpo&vim
function! SyntaxCheckers_go_golint_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat = '%f:%l:%c: %m,%-G%.%#'
let errorformat =
\ '%f:%l:%c: %m,' .
\ '%-G%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,

View file

@ -29,13 +29,11 @@ function! SyntaxCheckers_go_gotype_GetLocList() dict
" the package for the same reasons specified in go.vim ("figuring out
" the import path is fickle").
let errors = SyntasticMake({
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'cwd': expand('%:p:h'),
\ 'defaults': {'type': 'e'} })
return errors
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({

View file

@ -24,19 +24,21 @@ endfunction
function! SyntaxCheckers_go_govet_GetLocList() dict
let makeprg = 'go vet'
let errorformat = '%Evet: %.%\+: %f:%l:%c: %m,%W%f:%l: %m,%-G%.%#'
let errorformat =
\ '%Evet: %.%\+: %f:%l:%c: %m,' .
\ '%W%f:%l: %m,' .
\ '%-G%.%#'
" The go compiler needs to either be run with an import path as an
" argument or directly from the package directory. Since figuring out
" the proper import path is fickle, just cwd to the package.
let errors = SyntasticMake({
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'cwd': expand('%:p:h'),
\ 'defaults': {'type': 'w'} })
return errors
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({

View file

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

View file

@ -21,10 +21,33 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict
" We need either a Vim version that can handle NULs in system() output,
" or a ghc-mod version that has the --boundary option.
let exe = self.getExec()
let s:ghc_mod_new = executable(exe) ? s:GhcModNew(exe) : -1
if !executable(self.getExec())
return 0
endif
" ghc-mod 5.0.0 and later needs the "version" command to print the
" version. But the "version" command appeared in 4.1.0. Thus, we need to
" 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^ghc-mod version''')
if !len(ver)
" That didn't work. Try "ghc-mod" alone.
let ver = filter(split(system(self.getExecEscaped()), '\n'), 'v:val =~# ''\m^ghc-mod version''')
endif
if len(ver)
" Encouraged by the great success in finding out the version, now we
" need either a Vim that can handle NULs in system() output, or a
" ghc-mod that has the "--boundary" option.
let parsed_ver = syntastic#util#parseVersion(ver[0])
call self.log(self.getExec() . ' version =', parsed_ver)
let s:ghc_mod_new = syntastic#util#versionIsAtLeast(parsed_ver, [2, 1, 2])
else
call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
let s:ghc_mod_new = -1
endif
return (s:ghc_mod_new >= 0) && (v:version >= 704 || s:ghc_mod_new)
endfunction
@ -49,18 +72,6 @@ function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict
\ 'returns': [0] })
endfunction
function! s:GhcModNew(exe)
let exe = syntastic#util#shescape(a:exe)
try
let ghc_mod_version = filter(split(system(exe), '\n'), 'v:val =~# ''\m^ghc-mod version''')[0]
let ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(ghc_mod_version), [2, 1, 2])
catch /\m^Vim\%((\a\+)\)\=:E684/
call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
let ret = -1
endtry
return ret
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'haskell',
\ 'name': 'ghc_mod',

View file

@ -28,6 +28,8 @@ function! SyntaxCheckers_haxe_haxe_GetLocList() dict
endif
let hxml = fnamemodify(hxml, ':p')
call self.log('hxml =', hxml)
if hxml != ''
let makeprg = self.makeprgBuild({
\ 'fname': syntastic#util#shescape(fnamemodify(hxml, ':t')) })

View file

@ -19,8 +19,14 @@ set cpo&vim
function! SyntaxCheckers_html_jshint_IsAvailable() dict
call syntastic#log#deprecationWarn('jshint_exec', 'html_jshint_exec')
return executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [2,4])
if !executable(self.getExec())
return 0
endif
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', ver)
return syntastic#util#versionIsAtLeast(ver, [2, 4])
endfunction
function! SyntaxCheckers_html_jshint_GetLocList() dict

View file

@ -164,8 +164,8 @@ let s:empty_tags = [
lockvar! s:empty_tags
function! s:IgnoreError(text)
for i in s:ignore_errors + g:syntastic_html_tidy_ignore_errors
if stridx(a:text, i) != -1
for item in s:ignore_errors + g:syntastic_html_tidy_ignore_errors
if stridx(a:text, item) != -1
return 1
endif
endfor

View file

@ -27,19 +27,34 @@ endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_java_checkstyle_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
let classpath = expand(g:syntastic_java_checkstyle_classpath)
let conf_file = expand(g:syntastic_java_checkstyle_conf_file)
call self.log(
\ 'filereadable(' . string(classpath) . ') = ' . filereadable(classpath) . ', ' .
\ 'filereadable(' . string(conf_file) . ') = ' . filereadable(conf_file))
return filereadable(classpath) && filereadable(conf_file)
endfunction
function! SyntaxCheckers_java_checkstyle_GetLocList() dict
let fname = syntastic#util#shescape( expand('%:p:h') . '/' . expand('%:t') )
let fname = syntastic#util#shescape( expand('%:p:h') . syntastic#util#Slash() . expand('%:t') )
if has('win32unix')
let fname = substitute(system('cygpath -m ' . fname), '\m\%x00', '', 'g')
endif
let makeprg = self.makeprgBuild({
\ 'args_after': '-cp ' . g:syntastic_java_checkstyle_classpath .
\ ' com.puppycrawl.tools.checkstyle.Main -c ' .
\ syntastic#util#shexpand(g:syntastic_java_checkstyle_conf_file) .
\ ' -f xml',
\ 'args_after': [
\ '-cp', expand(g:syntastic_java_checkstyle_classpath),
\ 'com.puppycrawl.tools.checkstyle.Main',
\ '-c', expand(g:syntastic_java_checkstyle_conf_file),
\ '-f', 'xml'],
\ 'fname': fname })
let errorformat = '%f:%t:%l:%c:%m'

View file

@ -51,15 +51,7 @@ function! s:CygwinPath(path)
endfunction
if !exists('g:syntastic_java_javac_temp_dir')
if has('win32') || has('win64')
let g:syntastic_java_javac_temp_dir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-javac'
elseif has('win32unix')
let g:syntastic_java_javac_temp_dir = s:CygwinPath('/tmp/vim-syntastic-javac')
elseif $TMPDIR != ''
let g:syntastic_java_javac_temp_dir = $TMPDIR . '/vim-syntastic-javac'
else
let g:syntastic_java_javac_temp_dir = '/tmp/vim-syntastic-javac'
endif
let g:syntastic_java_javac_temp_dir = syntastic#util#tmpdir()
endif
if !exists('g:syntastic_java_javac_autoload_maven_classpath')
@ -90,18 +82,6 @@ function! s:RemoveCarriageReturn(line)
return substitute(a:line, "\r", '', 'g')
endfunction
" recursively remove directory and all it's sub-directories
function! s:RemoveDir(dir)
if isdirectory(a:dir)
for f in split(globpath(a:dir, '*'), "\n")
call s:RemoveDir(f)
endfor
silent! call system('rmdir ' . syntastic#util#shescape(a:dir))
else
silent! call delete(a:dir)
endif
endfunction
function! s:ClassSep()
return (syntastic#util#isRunningWindows() || has('win32unix')) ? ';' : ':'
endfunction
@ -419,7 +399,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
\ 'postprocess': ['cygwinRemoveCR'] })
if g:syntastic_java_javac_delete_output
call s:RemoveDir(output_dir)
call syntastic#util#rmrf(output_dir)
endif
return errors

View file

@ -20,25 +20,33 @@ set cpo&vim
function! SyntaxCheckers_javascript_closurecompiler_IsAvailable() dict
call syntastic#log#deprecationWarn('javascript_closure_compiler_path', 'javascript_closurecompiler_path')
return
\ executable("java") &&
\ exists("g:syntastic_javascript_closurecompiler_path") &&
\ filereadable(g:syntastic_javascript_closurecompiler_path)
if !executable(self.getExec())
return 0
endif
let cp = get(g:, 'syntastic_javascript_closurecompiler_path', '')
call self.log('g:syntastic_javascript_closurecompiler_path =', cp)
let jar = expand(cp)
call self.log('filereadable(' . string(jar) . ') = ' . filereadable(jar))
return filereadable(jar)
endfunction
function! SyntaxCheckers_javascript_closurecompiler_GetLocList() dict
call syntastic#log#deprecationWarn('javascript_closure_compiler_options', 'javascript_closurecompiler_args')
call syntastic#log#deprecationWarn('javascript_closure_compiler_file_list', 'javascript_closurecompiler_file_list')
if exists("g:syntastic_javascript_closurecompiler_file_list")
let file_list = join(readfile(g:syntastic_javascript_closurecompiler_file_list))
let flist = expand(get(g:, 'syntastic_javascript_closurecompiler_file_list', ''))
if filereadable(flist)
let file_list = map( readfile(flist), 'expand(v:var)' )
else
let file_list = syntastic#util#shexpand('%')
let file_list = [expand('%')]
endif
let makeprg = self.makeprgBuild({
\ 'exe_after': '-jar ' . g:syntastic_javascript_closurecompiler_path,
\ 'args_after': '--js' ,
\ 'exe_after': ['-jar', expand(g:syntastic_javascript_closurecompiler_path)],
\ 'args_after': '--js',
\ 'fname': file_list })
let errorformat =

View file

@ -18,9 +18,14 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_eslint_IsAvailable() dict
return
\ executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [0, 1])
if !executable(self.getExec())
return 0
endif
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', ver)
return syntastic#util#versionIsAtLeast(ver, [0, 1])
endfunction
function! SyntaxCheckers_javascript_eslint_GetLocList() dict
@ -35,7 +40,8 @@ function! SyntaxCheckers_javascript_eslint_GetLocList() dict
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
\ 'errorformat': errorformat,
\ 'postprocess': ['guards'] })
for e in loclist
let e['col'] += 1

View file

@ -22,7 +22,10 @@ function! SyntaxCheckers_javascript_jshint_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
let s:jshint_version = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', s:jshint_version)
return syntastic#util#versionIsAtLeast(s:jshint_version, [1])
endfunction

View file

@ -19,10 +19,14 @@ set cpo&vim
function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict
let jsxhint_version = system(self.getExecEscaped() . ' --version')
return
\ v:shell_error == 0 &&
\ jsxhint_version =~# '\m^JSXHint\>' &&
\ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(jsxhint_version), [0, 4, 1])
if v:shell_error || (jsxhint_version !~# '\m^JSXHint\>')
return 0
endif
let ver = syntastic#util#parseVersion(jsxhint_version)
call self.log(self.getExec() . ' version =', ver)
return syntastic#util#versionIsAtLeast(ver, [0, 4, 1])
endfunction
function! SyntaxCheckers_javascript_jsxhint_GetLocList() dict

View file

@ -36,6 +36,7 @@ set cpo&vim
let s:node_file = 'node ' . syntastic#util#shescape(expand('<sfile>:p:h') . syntastic#util#Slash() . 'less-lint.js')
function! SyntaxCheckers_less_lessc_IsAvailable() dict
call self.log('g:syntastic_less_use_less_lint =', g:syntastic_less_use_less_lint)
return g:syntastic_less_use_less_lint ? executable('node') : executable(self.getExec())
endfunction
@ -58,6 +59,7 @@ function! SyntaxCheckers_less_lessc_GetLocList() dict
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['guards'],
\ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} })
endfunction

View file

@ -47,7 +47,7 @@ endfunction
function! SyntaxCheckers_lua_luac_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-p' })
let errorformat = 'luac: %#%f:%l: %m'
let errorformat = 'luac: %#%f:%l: %m'
return SyntasticMake({
\ 'makeprg': makeprg,

View file

@ -0,0 +1,45 @@
"============================================================================
"File: mdl.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Charles Beynon <etothepiipower 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_markdown_mdl_checker")
finish
endif
let g:loaded_syntastic_markdown_mdl_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_markdown_mdl_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args': '--warnings' })
let errorformat =
\ '%E%f:%l: %m,'.
\ '%W%f: Kramdown Warning: %m found on line %l'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style' })
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'markdown',
\ 'name': 'mdl'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -0,0 +1,25 @@
"============================================================================
"File: igor.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_nroff_igor_checker')
finish
endif
let g:loaded_syntastic_nroff_igor_checker = 1
runtime! syntax_checkers/docbk/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'nroff',
\ 'name': 'igor',
\ 'redirect': 'docbk/igor'})
" vim: set et sts=4 sw=4:

View file

@ -26,6 +26,7 @@ function! SyntaxCheckers_objc_gcc_IsAvailable() dict
if !exists('g:syntastic_objc_compiler')
let g:syntastic_objc_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
endif
call self.log('g:syntastic_objc_compiler =', g:syntastic_objc_compiler)
return executable(expand(g:syntastic_objc_compiler))
endfunction

View file

@ -26,6 +26,7 @@ function! SyntaxCheckers_objcpp_gcc_IsAvailable() dict
if !exists('g:syntastic_c_compiler')
let g:syntastic_objcpp_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
endif
call self.log('g:syntastic_objcpp_compiler =', g:syntastic_objcpp_compiler)
return executable(expand(g:syntastic_objcpp_compiler))
endfunction

View file

@ -71,7 +71,7 @@ if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc')
endif
if !exists('g:syntastic_ocaml_use_janestreet_core')
let g:syntastic_ocaml_use_ocamlc = 0
let g:syntastic_ocaml_use_janestreet_core = 0
endif
if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable("ocamlbuild")

View file

@ -38,7 +38,8 @@ function! SyntaxCheckers_php_php_GetLocList() dict
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
\ 'errorformat': errorformat,
\ 'postprocess': ['guards'] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({

View file

@ -0,0 +1,91 @@
"============================================================================
"File: phplint.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_php_phplint_checker")
finish
endif
let g:loaded_syntastic_php_phplint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_php_phplint_GetHighlightRegex(item)
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
if term != ''
return '\V' . escape(term, '\')
endif
let term = matchstr(a:item['text'], '\m\(class\|function\|method\) \zs\S\+\ze was declared as')
if term != ''
return '\V' . escape(term, '\')
endif
let term = matchstr(a:item['text'], '\maccess forbidden to \(private\|protected\) \(class\|constant\|method\|variable\|\(private\|protected\) property\) \zs\S\+\ze')
if term != ''
return '\V' . escape(term, '\')
endif
let term = matchstr(a:item['text'], '\musing deprecated \(class\|constant\|method\|property\|variable\) \zs\S\+\ze')
if term != ''
return '\V' . escape(term, '\')
endif
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
if term != ''
return '\V' . escape(term, '\')
endif
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
if term != ''
return '\V' . escape(term, '\')
endif
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
return term != '' ? '\V' . escape(term, '\') : ''
endfunction
function! SyntaxCheckers_php_phplint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_after':
\ '--print-file-name ' .
\ '--print-line-numbers ' .
\ '--print-column-number ' .
\ '--print-errors ' .
\ '--print-warnings ' .
\ '--no-print-notices ' .
\ '--no-print-context ' .
\ '--no-print-source ' .
\ '--tab-size ' . &tabstop })
let errorformat =
\ '%E%f:%l:%v: %tRROR: %m,' .
\ '%W%f:%l:%v: %tarning: %m,' .
\ '%+C%\t%.%#,' .
\ '%-G%.%#'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['compressWhitespace'],
\ 'subtype': 'Style',
\ 'returns': [0, 1] })
for e in loclist
let e['text'] = substitute(e['text'], '\m \(Hint\|Examples\):.*', '', '')
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'php',
\ 'name': 'phplint',
\ 'exec': 'phpl' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -19,9 +19,12 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_puppet_puppet_GetLocList() dict
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
if !exists('s:puppet_version')
let s:puppet_version = syntastic#util#getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
call self.log(self.getExec() . ' version =', s:puppet_version)
endif
if syntastic#util#versionIsAtLeast(ver, [2,7,0])
if syntastic#util#versionIsAtLeast(s:puppet_version, [2,7,0])
let args = 'parser validate --color=false'
else
let args = '--color=false --parseonly'
@ -32,8 +35,8 @@ function! SyntaxCheckers_puppet_puppet_GetLocList() dict
let errorformat =
\ '%-Gerr: Try ''puppet help parser validate'' for usage,' .
\ '%-GError: Try ''puppet help parser validate'' for usage,' .
\ '%Eerr: Could not parse for environment %*[a-z]: %m at %f:%l,' .
\ '%EError: Could not parse for environment %*[a-z]: %m at %f:%l'
\ '%A%t%*[a-zA-Z]: %m at %f:%l:%c,' .
\ '%A%t%*[a-zA-Z]: %m at %f:%l'
return SyntasticMake({
\ 'makeprg': makeprg,

View file

@ -19,11 +19,16 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
return
\ executable("puppet") &&
\ executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull()), [0,1,10])
call self.log("executable('puppet') = " . executable('puppet') . ', ' .
\ "executable(" . string(self.getExec()) . ") = " . executable(self.getExec()))
if !executable('puppet') || !executable(self.getExec())
return 0
endif
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
call self.log(self.getExec() . ' version =', ver)
return syntastic#util#versionIsAtLeast(ver, [0, 1, 10])
endfunction
function! SyntaxCheckers_puppet_puppetlint_GetLocList() dict

View file

@ -42,7 +42,7 @@ function! SyntaxCheckers_python_frosted_GetLocList() dict
if len(parts) >= 4
let e["type"] = parts[1][0]
let e["text"] = parts[3] . ' [' . parts[1] . ']'
let e["hl"] = '\V' . escape(parts[2], '\')
let e["hl"] = '\V\<' . escape(parts[2], '\') . '\>'
elseif e["text"] =~? '\v^I\d+:'
let e["valid"] = 0
else

View file

@ -0,0 +1,35 @@
"============================================================================
"File: mypy.vim
"Description: Syntax checking plugin for syntastic.vim
"Author: Russ Hewgill <Russ dot Hewgill at gmail dot com>
"
"============================================================================
if exists("g:loaded_syntastic_python_mypy_checker")
finish
endif
let g:loaded_syntastic_python_mypy_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_mypy_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat = '%f\, line %l: %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': { 'type': 'E' },
\ 'returns': [0, 1] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'python',
\ 'name': 'mypy'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -15,8 +15,9 @@ set cpo&vim
function! SyntaxCheckers_python_pep257_GetLocList() dict
if !exists('s:pep257_new')
let s:pep257_new = syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version'), [0, 3])
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', ver)
let s:pep257_new = syntastic#util#versionIsAtLeast(ver, [0, 3])
endif
let makeprg = self.makeprgBuild({})

View file

@ -16,14 +16,38 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_pylint_IsAvailable() dict
let exe = self.getExec()
let s:pylint_new = executable(exe) ? s:PylintNew(exe) : -1
if !executable(self.getExec())
return 0
endif
try
" On Windows the version is shown as "pylint-script.py 1.0.0".
" On Gentoo Linux it's "pylint-python2.7 0.28.0".
" On NixOS, that would be ".pylint-wrapped 0.26.0".
" On Arch Linux it's "pylint2 1.1.0".
" 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'),
\ 'v:val =~# ''\m^\(python[-0-9]*-\|\.\)\=pylint[-0-9]*\>''' )[0]
let ver = syntastic#util#parseVersion(substitute(pylint_version, '\v^\S+\s+', '', ''))
call self.log(self.getExec() . ' version =', ver)
let s:pylint_new = syntastic#util#versionIsAtLeast(ver, [1])
catch /\m^Vim\%((\a\+)\)\=:E684/
call syntastic#log#error("checker python/pylint: can't parse version string (abnormal termination?)")
let s:pylint_new = -1
endtry
return s:pylint_new >= 0
endfunction
function! SyntaxCheckers_python_pylint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_after': (s:pylint_new ? '-f text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" -r n' : '-f parseable -r n -i y') })
\ 'args_after': (s:pylint_new ?
\ '-f text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" -r n' :
\ '-f parseable -r n -i y') })
let errorformat =
\ '%A%f:%l:%c:%t: %m,' .
@ -62,24 +86,6 @@ function! SyntaxCheckers_python_pylint_GetLocList() dict
return loclist
endfunction
function! s:PylintNew(exe)
let exe = syntastic#util#shescape(a:exe)
try
" On Windows the version is shown as "pylint-script.py 1.0.0".
" On Gentoo Linux it's "pylint-python2.7 0.28.0".
" On NixOS, that would be ".pylint-wrapped 0.26.0".
" On Arch Linux it's "pylint2 1.1.0".
" Have you guys considered switching to creative writing yet? ;)
let pylint_version = filter(split(system(exe . ' --version'), '\m, \=\|\n'), 'v:val =~# ''\m^\.\=pylint[-0-9]*\>''')[0]
let pylint_version = substitute(pylint_version, '\v^\S+\s+', '', '')
let ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1])
catch /\m^Vim\%((\a\+)\)\=:E684/
call syntastic#log#error("checker python/pylint: can't parse version string (abnormal termination?)")
let ret = -1
endtry
return ret
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'python',
\ 'name': 'pylint' })

View file

@ -21,8 +21,14 @@ set cpo&vim
let s:compiler = expand('<sfile>:p:h') . syntastic#util#Slash() . 'compile.py'
function! SyntaxCheckers_python_python_IsAvailable() dict
return executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [2, 6])
if !executable(self.getExec())
return 0
endif
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', ver)
return syntastic#util#versionIsAtLeast(ver, [2, 6])
endfunction
function! SyntaxCheckers_python_python_GetLocList() dict

View file

@ -0,0 +1,38 @@
"============================================================================
"File: rnv.vim
"Description: RelaxNG RNV syntax checking plugin for syntastic.vim
"Maintainer: Remko Tronçon <remko at el-tramo dot be>
"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_rnc_rnv_checker")
finish
endif
let g:loaded_syntastic_rnc_rnv_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_rnc_rnv_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args': '-c' })
let errorformat =
\ '%f:%l:%c: %trror: %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'rnc',
\ 'name': 'rnv'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -1,6 +1,6 @@
"============================================================================
"File: rst.vim
"Description: Syntax checking plugin for docutil's reStructuredText files
"Description: Syntax checking plugin for docutils' reStructuredText files
"Maintainer: James Rowe <jnrowe 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

View file

@ -21,6 +21,7 @@ set cpo&vim
function! SyntaxCheckers_ruby_mri_IsAvailable() dict
if !exists('g:syntastic_ruby_mri_exec') && exists('g:syntastic_ruby_exec')
let g:syntastic_ruby_mri_exec = g:syntastic_ruby_exec
call self.log('g:syntastic_ruby_exec =', g:syntastic_ruby_exec)
endif
return executable(self.getExec())
endfunction
@ -44,7 +45,7 @@ function! SyntaxCheckers_ruby_mri_GetLocList() dict
"
"Which always generate the warning below. Note that ruby >= 1.9.3 includes
"the word "possibly" in the warning
let errorformat = '%-G%.%#warning: %\(possibly %\)%\?useless use of == in void context,'
let errorformat = '%-G%\m%.%#warning: %\%%(possibly %\)%\?useless use of == in void context,'
" filter out lines starting with ...
" long lines are truncated and wrapped in ... %p then returns the wrong

View file

@ -22,9 +22,14 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_ruby_rubocop_IsAvailable() dict
return
\ executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [0, 9, 0])
if !executable(self.getExec())
return 0
endif
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', ver)
return syntastic#util#versionIsAtLeast(ver, [0, 9, 0])
endfunction
function! SyntaxCheckers_ruby_rubocop_GetLocList() dict

View file

@ -21,8 +21,9 @@ set cpo&vim
function! SyntaxCheckers_ruby_rubylint_GetLocList() dict
if !exists('s:rubylint_new')
let s:rubylint_new = syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version'), [2])
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', ver)
let s:rubylint_new = syntastic#util#versionIsAtLeast(ver, [2])
endif
let makeprg = self.makeprgBuild({ 'args': (s:rubylint_new ? '' : 'analyze ') . '--presenter=syntastic' })

View file

@ -17,9 +17,13 @@ let g:loaded_syntastic_sass_sass_checker = 1
"sass caching for large files drastically speeds up the checking, but store it
"in a temp location otherwise sass puts .sass_cache dirs in the users project
let s:sass_cache_location = tempname()
let s:sass_cache_location = syntastic#util#tmpdir()
lockvar s:sass_cache_location
augroup syntastic
autocmd VimLeave * call syntastic#util#rmrf(s:sass_cache_location)
augroup END
"By default do not check partials as unknown variables are a syntax error
if !exists("g:syntastic_sass_check_partials")
let g:syntastic_sass_check_partials = 0
@ -43,7 +47,7 @@ function! SyntaxCheckers_sass_sass_GetLocList() dict
\ 'args_before': '--cache-location ' . s:sass_cache_location . ' ' . s:imports . ' --check' })
let errorformat =
\ '%ESyntax %trror: %m,' .
\ '%E%\m%\%%(Syntax %\)%\?%trror: %m,' .
\ '%+C %.%#,' .
\ '%C on line %l of %f\, %.%#,' .
\ '%C on line %l of %f,' .

View file

@ -0,0 +1,77 @@
"============================================================================
"File: scalastyle.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_scala_scalastyle_checker')
finish
endif
let g:loaded_syntastic_scala_scalastyle_checker = 1
if !exists('g:syntastic_scala_scalastyle_jar')
let g:syntastic_scala_scalastyle_jar = 'scalastyle-batch_2.10.jar'
endif
if !exists('g:syntastic_scala_scalastyle_config_file')
let g:syntastic_scala_scalastyle_config_file = 'scalastyle_config.xml'
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_scala_scalastyle_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
let jar = expand(g:syntastic_scala_scalastyle_jar)
let conf_file = expand(g:syntastic_scala_scalastyle_config_file)
call self.log('filereadable(' . string(jar) . ') = ' . filereadable(jar) . ', ' .
\ 'filereadable(' . string(conf_file) . ') = ' . filereadable(conf_file))
return filereadable(jar) && filereadable(conf_file)
endfunction
function! SyntaxCheckers_scala_scalastyle_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe_after': ['-jar', expand(g:syntastic_scala_scalastyle_jar)],
\ 'args_before': ['-q', 'true', '-c', expand(g:syntastic_scala_scalastyle_config_file)] })
let errorformat =
\ '%trror file=%f message=%m line=%l column=%c,' .
\ '%trror file=%f message=%m line=%l,' .
\ '%tarning file=%f message=%m line=%l column=%c,' .
\ '%tarning file=%f message=%m line=%l'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'returns': [0, 1] })
for e in loclist
if has_key(e, 'col')
let e['col'] += 1
endif
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'scala',
\ 'name': 'scalastyle',
\ 'exec': 'java'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -18,10 +18,14 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_scss_scss_lint_IsAvailable() dict
return
\ executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version'), [0, 12])
if !executable(self.getExec())
return 0
endif
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', ver)
return syntastic#util#versionIsAtLeast(ver, [0, 12])
endfunction
function! SyntaxCheckers_scss_scss_lint_GetLocList() dict
@ -31,7 +35,7 @@ function! SyntaxCheckers_scss_scss_lint_GetLocList() dict
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'returns': [0, 1, 65] })
\ 'returns': [0, 1, 2, 65, 66] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({

View file

@ -19,6 +19,7 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_sh_sh_IsAvailable() dict
call self.log('shell =', s:GetShell())
return s:IsShellValid()
endfunction
@ -57,7 +58,7 @@ function! s:GetShell()
endif
" try to use env variable in case no shebang could be found
if b:shell == ''
let b:shell = fnamemodify(expand('$SHELL'), ':t')
let b:shell = fnamemodify($SHELL, ':t')
endif
endif
return b:shell

View file

@ -20,8 +20,9 @@ set cpo&vim
function! SyntaxCheckers_slim_slimrb_GetLocList() dict
if !exists('s:slimrb_new')
let s:slimrb_new = syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version 2>'. syntastic#util#DevNull()), [1, 3, 1])
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version 2>'. syntastic#util#DevNull())
call self.log(self.getExec() . ' version =', ver)
let s:slimrb_new = syntastic#util#versionIsAtLeast(ver, [1, 3, 1])
endif
let makeprg = self.makeprgBuild({ 'args_after': '-c' })

View file

@ -0,0 +1,43 @@
"============================================================================
"File: rpmlint.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_spec_rpmlint_checker')
finish
endif
let g:loaded_syntastic_spec_rpmlint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_spec_rpmlint_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat =
\ '%E%f:%l: E: %m,' .
\ '%E%f: E: %m,' .
\ '%W%f:%l: W: %m,' .
\ '%W%f: W: %m,' .
\ '%-G%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'spec',
\ 'name': 'rpmlint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View file

@ -9,19 +9,6 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
"
" For details about ChkTeX see:
"
" http://baruch.ev-en.org/proj/chktex/
"
" Checker options:
"
" - g:syntastic_tex_chktex_showmsgs (boolean; default: 1)
" whether to show informational messages (chktex option "-m");
" by default informational messages are shown as warnings
"
" - g:syntastic_tex_chktex_args (string; default: empty)
" command line options to pass to chktex
if exists('g:loaded_syntastic_tex_chktex_checker')
finish

View file

@ -44,6 +44,8 @@ function! SyntaxCheckers_text_atdtool_GetLocList() dict
let e['text'] = substitute(e['text'], '\m\n\s\+', ' | ', 'g')
endfor
call self.setWantSort(1)
return loclist
endfunction

View file

@ -0,0 +1,25 @@
"============================================================================
"File: igor.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_text_igor_checker')
finish
endif
let g:loaded_syntastic_text_igor_checker = 1
runtime! syntax_checkers/docbk/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'text',
\ 'name': 'igor',
\ 'redirect': 'docbk/igor'})
" vim: set et sts=4 sw=4:

View file

@ -63,7 +63,7 @@ function! s:GetValaVapiDirs()
elseif type(g:syntastic_vala_vapi_dirs) == type([])
return copy(g:syntastic_vala_vapi_dirs)
else
echoerr 'g:syntastic_vala_vapi_dirs must be either list or string: fallback to in file modules string'
echoerr 'g:syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string'
endif
endif

View file

@ -20,6 +20,7 @@ function! SyntaxCheckers_verilog_verilator_IsAvailable() dict
if !exists('g:syntastic_verilog_compiler')
let g:syntastic_verilog_compiler = self.getExec()
endif
call self.log('g:syntastic_verilog_compiler =', g:syntastic_verilog_compiler)
return executable(expand(g:syntastic_verilog_compiler))
endfunction

View file

@ -36,9 +36,11 @@ function! SyntaxCheckers_vim_vimlint_GetHighlightRegex(item)
endfunction
function! SyntaxCheckers_vim_vimlint_IsAvailable() dict
return
\ globpath(&runtimepath, 'autoload/vimlparser.vim') != '' &&
\ globpath(&runtimepath, 'autoload/vimlint.vim') != ''
let vimlparser = globpath(&runtimepath, 'autoload/vimlparser.vim')
let vimlint = globpath(&runtimepath, 'autoload/vimlint.vim')
call self.log("globpath(&runtimepath, 'autoload/vimlparser.vim') = " . string(vimlparser) . ', ' .
\ "globpath(&runtimepath, 'autoload/vimlint.vim') = " . string(vimlint))
return vimlparser != '' && vimlint != ''
endfunction
function! SyntaxCheckers_vim_vimlint_GetLocList() dict

View file

@ -47,8 +47,8 @@ function! s:TidyEncOptByFenc()
endfunction
function! s:IgnoreError(text)
for i in g:syntastic_xhtml_tidy_ignore_errors
if stridx(a:text, i) != -1
for item in g:syntastic_xhtml_tidy_ignore_errors
if stridx(a:text, item) != -1
return 1
endif
endfor

View file

@ -23,8 +23,9 @@ set cpo&vim
function! SyntaxCheckers_yaml_jsyaml_GetLocList() dict
if !exists('s:js_yaml_new')
let s:js_yaml_new =
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [2])
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
call self.log(self.getExec() . ' version =', ver)
let s:js_yaml_new = syntastic#util#versionIsAtLeast(ver, [2])
endif
let makeprg = self.makeprgBuild({ 'args_after': (s:js_yaml_new ? '' : '--compact') })

View file

@ -191,7 +191,7 @@ MIT License. Copyright (c) 2013-2014 Bailey Ling.
[17]: https://github.com/mbbill/undotree
[18]: https://github.com/scrooloose/nerdtree
[19]: https://github.com/majutsushi/tagbar
[20]: https://powerline.readthedocs.org/en/latest/fontpatching.html
[20]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts
[21]: https://bitbucket.org/ludovicchabant/vim-lawrencium
[22]: https://github.com/MarcWeber/vim-addon-manager
[23]: https://github.com/altercation/solarized

View file

@ -156,7 +156,7 @@ function! airline#check_mode(winnr)
call add(l:mode, 'paste')
endif
if &readonly
if &readonly || ! &modifiable
call add(l:mode, 'readonly')
endif

View file

@ -215,6 +215,10 @@ function! airline#extensions#load()
call airline#extensions#capslock#init(s:ext)
endif
if (get(g:, 'airline#extensions#windowswap#enabled', 1) && get(g:, 'loaded_windowswap', 0))
call airline#extensions#windowswap#init(s:ext)
endif
if !get(g:, 'airline#extensions#disable_rtp_load', 0)
" load all other extensions, which are not part of the default distribution.
" (autoload/airline/extensions/*.vim outside of our s:script_path).

View file

@ -21,7 +21,12 @@ function! s:get_git_branch(path)
else
try
let line = join(readfile(dir . '/HEAD'))
let name = strpart(line, 16)
if strpart(line, 0, 16) == 'ref: refs/heads/'
let name = strpart(line, 16)
else
" raw commit hash
let name = strpart(line, 0, 7)
endif
catch
let name = ''
endtry
@ -37,9 +42,11 @@ function! airline#extensions#branch#head()
endif
let b:airline_head = ''
let found_fugitive_head = 0
if s:has_fugitive && !exists('b:mercurial_dir')
let b:airline_head = fugitive#head()
let b:airline_head = fugitive#head(7)
let found_fugitive_head = 1
if empty(b:airline_head) && !exists('b:git_dir')
let b:airline_head = s:get_git_branch(expand("%:p:h"))
@ -61,7 +68,7 @@ function! airline#extensions#branch#head()
endif
endif
if empty(b:airline_head) || !s:check_in_path()
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
let b:airline_head = ''
endif

View file

@ -63,7 +63,11 @@ function! airline#extensions#default#apply(builder, context)
if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
call <sid>build_sections(a:builder, a:context, s:layout[0])
else
call a:builder.add_section('airline_c'.(a:context.bufnr), ' %f%m ')
let text = <sid>get_section(winnr, 'c')
if empty(text)
let text = ' %f%m '
endif
call a:builder.add_section('airline_c'.(a:context.bufnr), text)
endif
call a:builder.split(s:get_section(winnr, 'gutter', '', ''))

View file

@ -7,7 +7,9 @@ let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
let s:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
let s:show_close_button = get(g:, 'airline#extensions#tabline#show_close_button', 1)
let s:close_symbol = get(g:, 'airline#extensions#tabline#close_symbol', 'X')
let s:buffer_idx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0)
let s:builder_context = {
\ 'active' : 1,
@ -26,6 +28,21 @@ let s:buf_min_count = get(g:, 'airline#extensions#tabline#buffer_min_count', 0)
let s:tab_min_count = get(g:, 'airline#extensions#tabline#tab_min_count', 0)
let s:spc = g:airline_symbols.space
let s:number_map = &encoding == 'utf-8'
\ ? {
\ '0': '⁰',
\ '1': '¹',
\ '2': '²',
\ '3': '³',
\ '4': '⁴',
\ '5': '⁵',
\ '6': '⁶',
\ '7': '⁷',
\ '8': '⁸',
\ '9': '⁹'
\ }
\ : {}
function! airline#extensions#tabline#init(ext)
if has('gui_running')
set guioptions-=e
@ -37,6 +54,9 @@ function! airline#extensions#tabline#init(ext)
call s:toggle_on()
call a:ext.add_theme_func('airline#extensions#tabline#load_theme')
if s:buffer_idx_mode
call s:define_buffer_idx_mode_mappings()
endif
endfunction
function! s:toggle_off()
@ -71,12 +91,20 @@ function! airline#extensions#tabline#load_theme(palette)
let l:tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
let l:tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
let l:tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c)
else
"Fall back to normal airline_c if modified airline_c isn't present
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
endif
let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
call airline#highlighter#exec('airline_tab', l:tab)
call airline#highlighter#exec('airline_tabsel', l:tabsel)
call airline#highlighter#exec('airline_tabtype', l:tabtype)
call airline#highlighter#exec('airline_tabfill', l:tabfill)
call airline#highlighter#exec('airline_tabmod', l:tabmod)
call airline#highlighter#exec('airline_tabmod_unsel', l:tabmodu)
call airline#highlighter#exec('airline_tabhid', l:tabhid)
endfunction
@ -93,7 +121,12 @@ function! s:on_cursormove(min_count, total_count)
endfunction
function! airline#extensions#tabline#get()
if s:show_buffers && tabpagenr('$') == 1
let curtabcnt = tabpagenr('$')
if curtabcnt != s:current_tabcnt
let s:current_tabcnt = curtabcnt
let s:current_bufnr = -1 " force a refresh...
endif
if s:show_buffers && curtabcnt == 1
return s:get_buffers()
else
return s:get_tabs()
@ -180,11 +213,13 @@ function! s:get_visible_buffers()
endif
endif
let g:current_visible_buffers = buffers
return buffers
endfunction
let s:current_bufnr = -1
let s:current_tabnr = -1
let s:current_tabcnt = -1
let s:current_tabline = ''
let s:current_modified = 0
function! s:get_buffers()
@ -195,6 +230,7 @@ function! s:get_buffers()
endif
endif
let l:index = 1
let b = airline#builder#new(s:builder_context)
let tab_bufs = tabpagebuflist(tabpagenr())
for nr in s:get_visible_buffers()
@ -202,6 +238,7 @@ function! s:get_buffers()
call b.add_raw('%#airline_tabhid#...')
continue
endif
if cur == nr
if g:airline_detect_modified && getbufvar(nr, '&modified')
let group = 'airline_tabmod'
@ -210,13 +247,25 @@ function! s:get_buffers()
endif
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
else
if index(tab_bufs, nr) > -1
if g:airline_detect_modified && getbufvar(nr, '&modified')
let group = 'airline_tabmod_unsel'
elseif index(tab_bufs, nr) > -1
let group = 'airline_tab'
else
let group = 'airline_tabhid'
endif
endif
call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
if s:buffer_idx_mode
if len(s:number_map) > 0
call b.add_section(group, s:spc . get(s:number_map, l:index, '') . '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)' . s:spc)
else
call b.add_section(group, '['.l:index.s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.']')
endif
let l:index = l:index + 1
else
call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
endif
endfor
call b.add_section('airline_tabfill', '')
@ -228,6 +277,35 @@ function! s:get_buffers()
return s:current_tabline
endfunction
function! s:select_tab(buf_index)
" no-op when called in the NERDTree buffer
if exists('t:NERDTreeBufName') && bufname('%') == t:NERDTreeBufName
return
endif
let idx = a:buf_index
if g:current_visible_buffers[0] == -1
let idx = idx + 1
endif
let buf = get(g:current_visible_buffers, idx, 0)
if buf != 0
exec 'b!' . buf
endif
endfunction
function! s:define_buffer_idx_mode_mappings()
noremap <unique> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
noremap <unique> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
noremap <unique> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
noremap <unique> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
noremap <unique> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
noremap <unique> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
noremap <unique> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
noremap <unique> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
noremap <unique> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
endfunction
function! s:get_tabs()
let curbuf = bufnr('%')
let curtab = tabpagenr()
@ -266,7 +344,9 @@ function! s:get_tabs()
call b.add_raw('%T')
call b.add_section('airline_tabfill', '')
call b.split()
call b.add_section('airline_tab', ' %999X'.s:close_symbol.' ')
if s:show_close_button
call b.add_section('airline_tab', ' %999X'.s:close_symbol.' ')
endif
if s:show_tab_type
call b.add_section('airline_tabtype', ' tabs ')
endif

View file

@ -0,0 +1,23 @@
" vim: et ts=2 sts=2 sw=2
if !exists('g:loaded_windowswap')
finish
endif
let s:spc = g:airline_symbols.space
if !exists('g:airline#extensions#windowswap#indicator_text')
let g:airline#extensions#windowswap#indicator_text = 'WS'
endif
function! airline#extensions#windowswap#init(ext)
call airline#parts#define_function('windowswap', 'airline#extensions#windowswap#get_status')
endfunction
function! airline#extensions#windowswap#get_status()
if WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr()
return g:airline#extensions#windowswap#indicator_text.s:spc
endif
return ''
endfunction

View file

@ -78,7 +78,7 @@ function! airline#init#bootstrap()
call airline#parts#define_raw('file', '%f%m')
call airline#parts#define_raw('linenr', '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#')
call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace'])
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace','windowswap'])
call airline#parts#define_text('capslock', '')
unlet g:airline#init#bootstrapping
@ -105,7 +105,7 @@ function! airline#init#sections()
let g:airline_section_y = airline#section#create_right(['ffenc'])
endif
if !exists('g:airline_section_z')
let g:airline_section_z = airline#section#create(['%3p%%'.spc, 'linenr', ':%3c '])
let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', ':%3c '])
endif
if !exists('g:airline_section_warning')
let g:airline_section_warning = airline#section#create(['syntastic', 'eclim', 'whitespace'])

View file

@ -49,7 +49,7 @@ function! s:create(parts, append)
endif
if exists('part.condition')
let partval = substitute(partval, '{', '{'.(part.condition).' ? ', '')
let partval = substitute(partval, '{', '\="{".(part.condition)." ? "', '')
let partval = substitute(partval, '}', ' : ""}', '')
endif

View file

@ -1,43 +1,52 @@
"
" Colorscheme: Kalisi for airline. Inspired by powerline.
" 06.02.2014 Arthur Jaron
" Arthur Jaron
" hifreeo@gmail.com
"
" 30.07.2014
" Insert mode
let s:I1 = [ '#ffffff' , '#e80000' , 23 , 231 ]
let s:I2 = [ '#c5c5c5' , '#901010' , 74 , 31 ]
let s:I3 = [ '#c5c5c5' , '#500000' , 117 , 24 ]
let s:I1 = [ '#ffffff' , '#e80000','','']
let s:I2 = [ '#c5c5c5' , '#901010','','']
let s:I3 = [ '#c5c5c5' , '#500000','','']
" Visual mode
let s:V1 = [ '#005f5f' , '#ffffff' , 23 , 231 ]
let s:V2 = [ '#5fafd7' , '#0087af' , 74 , 31 ]
let s:V3 = [ '#87d7ff' , '#005f87' , 117 , 24 ]
" Visual mode
let s:V1 = [ '#2a5d8e' , '#ffffff','','']
let s:V2 = [ '#87e7ff' , '#4077df','','']
let s:V3 = [ '#87e7ff' , '#2a5d8e','','']
" Replace mode
let s:R1 = [ '#8e00da' , '#ffffff' , 23 , 231 ]
let s:R2 = [ '#8e00da' , '#ce99ff' , 74 , 31 ]
let s:R3 = [ '#ce99ff' , '#8e00da' , 117 , 24 ]
let s:R1 = [ '#6e00ba' , '#ffffff','','']
let s:R2 = [ '#6e00ba' , '#d358ff','','']
let s:R3 = [ '#ce99ff' , '#6e00ba','','']
let g:airline#themes#kalisi#palette = {}
let g:airline#themes#kalisi#palette.accents = {'red': ['#FF0000', '', 88, '']}
function! airline#themes#kalisi#refresh()
let s:StatusLine = airline#themes#get_highlight('StatusLine')
let s:StatusLineNC = airline#themes#get_highlight('StatusLineNC')
" Normal mode
let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ]
let s:N2 = [ '#afd700' , '#005f00' , 247 , 236 ]
let s:N3 = airline#themes#get_highlight('StatusLine')
let s:N1 = [ '#005f00' , '#afd700','','']
let s:N2 = [ '#afd700' , '#005f00','','']
let s:N3 = s:StatusLine
" Tabline Plugin
let g:airline#themes#kalisi#palette.tabline = {
\ 'airline_tab': ['#A6DB29', '#005f00', 231, 29, ''],
\ 'airline_tabsel': ['#404042', '#A6DB29', 231, 36, ''],
\ 'airline_tabtype': ['#afd700', '#005f00', 231, 36, ''],
\ 'airline_tabfill': ['#ffffff', '#000000', 231, 23, ''],
\ 'airline_tabhid': ['#c5c5c5', '#404042', 231, 88, ''],
\ 'airline_tabmod': ['#ffffff', '#F1266F', 231, 88, ''],
\ 'airline_tab': ['#A6DB29', '#005f00','',''],
\ 'airline_tabsel': ['#404042', '#A6DB29','',''],
\ 'airline_tabtype': ['#afd700', '#204d20','',''],
\ 'airline_tabfill': s:StatusLine,
\ 'airline_tabhid': ['#c5c5c5', '#404042','',''],
\ 'airline_tabmod': ['#ffffff', '#F1266F','','']
\ }
" \ 'airline_tabfill': ['#ffffff', '#2b2b2b','',''],
let g:airline#themes#kalisi#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#kalisi#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#kalisi#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
@ -55,3 +64,11 @@ endfunction
call airline#themes#kalisi#refresh()
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#kalisi#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ s:StatusLineNC,
\ s:StatusLine,
\ [ '#005f00' , '#afd700' , '','', ''] )

View file

@ -0,0 +1,85 @@
let g:airline#themes#raven#palette = {}
let g:airline#themes#raven#palette.accents = {
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
\ }
let s:N1 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
let s:N2 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
let s:N3 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
let g:airline#themes#raven#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#raven#palette.normal_modified = {
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
\ }
let s:I1 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
let s:I2 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
let s:I3 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
let g:airline#themes#raven#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#raven#palette.insert_modified = {
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
\ }
let g:airline#themes#raven#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , '#2e2e2e' , s:I1[2] , 235 , '' ] ,
\ }
let g:airline#themes#raven#palette.replace = copy(g:airline#themes#raven#palette.insert)
let g:airline#themes#raven#palette.replace.airline_a = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
let g:airline#themes#raven#palette.replace.airline_z = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
let g:airline#themes#raven#palette.replace_modified = g:airline#themes#raven#palette.insert_modified
let s:V1 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
let s:V2 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
let s:V3 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
let g:airline#themes#raven#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#raven#palette.visual_modified = {
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
\ }
let s:IA = [ '#5e5e5e' , '#222222' , 59 , 235 , '' ]
let g:airline#themes#raven#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#raven#palette.inactive_modified = {
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
\ }
let g:airline#themes#raven#palette.tabline = {
\ 'airline_tab': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
\ 'airline_tabsel': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
\ 'airline_tabtype': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
\ 'airline_tabfill': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
\ 'airline_tabmod': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
\ }
let s:WI = [ '#ff0000', '#2e2e2e', 196, 235 ]
let g:airline#themes#raven#palette.normal.airline_warning = [
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
\ ]
let g:airline#themes#raven#palette.normal_modified.airline_warning =
\ g:airline#themes#raven#palette.normal.airline_warning
let g:airline#themes#raven#palette.insert.airline_warning =
\ g:airline#themes#raven#palette.normal.airline_warning
let g:airline#themes#raven#palette.insert_modified.airline_warning =
\ g:airline#themes#raven#palette.normal.airline_warning
let g:airline#themes#raven#palette.visual.airline_warning =
\ g:airline#themes#raven#palette.normal.airline_warning
let g:airline#themes#raven#palette.visual_modified.airline_warning =
\ g:airline#themes#raven#palette.normal.airline_warning
let g:airline#themes#raven#palette.replace.airline_warning =
\ g:airline#themes#raven#palette.normal.airline_warning
let g:airline#themes#raven#palette.replace_modified.airline_warning =
\ g:airline#themes#raven#palette.normal.airline_warning
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#raven#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
\ [ '#2e2e2e' , '#a4c639' , 235 , 149 , '' ] )

View file

@ -0,0 +1,85 @@
let g:airline#themes#silver#palette = {}
let g:airline#themes#silver#palette.accents = {
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
\ }
let s:N1 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
let s:N2 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
let s:N3 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
let g:airline#themes#silver#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#silver#palette.normal_modified = {
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
\ }
let s:I1 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
let s:I2 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
let s:I3 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
let g:airline#themes#silver#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#silver#palette.insert_modified = {
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
\ }
let g:airline#themes#silver#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , '#e1e1e1' , s:I1[2] , 188 , '' ] ,
\ }
let g:airline#themes#silver#palette.replace = copy(g:airline#themes#silver#palette.insert)
let g:airline#themes#silver#palette.replace.airline_a = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
let g:airline#themes#silver#palette.replace.airline_z = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
let g:airline#themes#silver#palette.replace_modified = g:airline#themes#silver#palette.insert_modified
let s:V1 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
let s:V2 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
let s:V3 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
let g:airline#themes#silver#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#silver#palette.visual_modified = {
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
\ }
let s:IA = [ '#a1a1a1' , '#dddddd' , 145 , 188 , '' ]
let g:airline#themes#silver#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#silver#palette.inactive_modified = {
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
\ }
let g:airline#themes#silver#palette.tabline = {
\ 'airline_tab': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
\ 'airline_tabsel': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
\ 'airline_tabtype': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
\ 'airline_tabfill': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
\ 'airline_tabmod': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
\ }
let s:WI = [ '#ff0000', '#e1e1e1', 196, 188 ]
let g:airline#themes#silver#palette.normal.airline_warning = [
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
\ ]
let g:airline#themes#silver#palette.normal_modified.airline_warning =
\ g:airline#themes#silver#palette.normal.airline_warning
let g:airline#themes#silver#palette.insert.airline_warning =
\ g:airline#themes#silver#palette.normal.airline_warning
let g:airline#themes#silver#palette.insert_modified.airline_warning =
\ g:airline#themes#silver#palette.normal.airline_warning
let g:airline#themes#silver#palette.visual.airline_warning =
\ g:airline#themes#silver#palette.normal.airline_warning
let g:airline#themes#silver#palette.visual_modified.airline_warning =
\ g:airline#themes#silver#palette.normal.airline_warning
let g:airline#themes#silver#palette.replace.airline_warning =
\ g:airline#themes#silver#palette.normal.airline_warning
let g:airline#themes#silver#palette.replace_modified.airline_warning =
\ g:airline#themes#silver#palette.normal.airline_warning
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#silver#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
\ [ '#e1e1e1' , '#007599' , 188 , 30 , '' ] )

View file

@ -404,6 +404,25 @@ eclim <https://eclim.org>
* enable/disable displaying tab type (far right)
let g:airline#extensions#tabline#show_tab_type = 1
* enable/disable displaying index of the buffer.
When enabled, numbers will be displayed in the tabline and mappings will be
exposed to allow you to select a buffer directly. Up to 9 mappings will be
exposed.
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
Note: Mappings will be ignored within a NERDTree buffer.
* defines the name of a formatter for how buffer names are displayed. >
let g:airline#extensions#tabline#formatter = 'default'
@ -453,6 +472,9 @@ eclim <https://eclim.org>
let g:airline#extensions#tabline#right_sep = ''
let g:airline#extensions#tabline#right_alt_sep = ''
* configure whether close button should be shown
let g:airline#extensions#tabline#show_close_button = 1
* configure symbol used to represent close button
let g:airline#extensions#tabline#close_symbol = 'X'
@ -507,6 +529,15 @@ vim-capslock <https://github.com/tpope/vim-capslock>
* enable/disable vim-capslock integration >
let g:airline#extensions#capslock#enabled = 1
------------------------------------- *airline-windowswap*
vim-windowswap <https://github.com/wesQ3/vim-windowswap>
* enable/disable vim-windowswap integration >
let g:airline#extensions#windowswap#enabled = 1
* set marked window indicator string >
let g:airline#extensions#windowswap#indicator_text = 'WS'
<
==============================================================================
ADVANCED CUSTOMIZATION *airline-advanced-customization*

View file

@ -1,7 +1,7 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2010 to 2012 Mick Koch <kchmck@gmail.com>
Copyright (C) 2010 to 2014 Mick Koch <mick@kochm.co>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long

View file

@ -1,3 +1,7 @@
### Version 003 (October 10, 2014)
Almost 3 years' worth of fixes and (hopefully) improvements.
### Version 002 (December 5, 2011)
Added binary numbers (0b0101) and fixed some bugs (#9, #62, #63, #65).

View file

@ -91,7 +91,7 @@ Updating takes two steps:
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'kchmck/vim-coffee-script'
Plugin 'kchmck/vim-coffee-script'
syntax enable
filetype plugin indent on
@ -100,9 +100,9 @@ Updating takes two steps:
If you're adding Vundle to a built-up vimrc, just make sure all these calls
are in there and that they occur in this order.
3. Open vim and run `:BundleInstall`.
3. Open vim and run `:PluginInstall`.
To update, open vim and run `:BundleInstall!` (notice the bang!)
To update, open vim and run `:PluginInstall!` (notice the bang!)
## Install from a Zip File
@ -313,7 +313,7 @@ the given `RANGE` and any extra `COFFEE-OPTIONS` are passed to `coffee`.
## CoffeeLint: Lint your CoffeeScript
CoffeeLint runs [coffeelint](http://www.coffeelint.org/) (version 0.5.7 or later
CoffeeLint runs [coffeelint](http://www.coffeelint.org/) (version 1.4.0 or later
required) on the current file and adds any issues to the [quickfix] list.
![CoffeeLint](http://i.imgur.com/UN8Nr5N.png)

View file

@ -1,5 +1,5 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL

Some files were not shown because too many files have changed in this diff Show more