diff --git a/bundle/compiler_pylint/bin/pylint_parseable.py b/bundle/compiler_pylint/bin/pylint_parseable.py index 1d5b1b5..d16865a 100755 --- a/bundle/compiler_pylint/bin/pylint_parseable.py +++ b/bundle/compiler_pylint/bin/pylint_parseable.py @@ -5,7 +5,7 @@ a "make" command for VIm """ import sys import re -from StringIO import StringIO +from cStringIO import StringIO from optparse import OptionParser from pylint import lint @@ -56,7 +56,7 @@ def parsable_pylint(filename): error_list = [] carriage_re = re.compile(r'\s*\^+$') - error_re = re.compile(r'^([C,R,W,E,F].+):\s+?([0-9]+):?.*:\s(.*)$') + error_re = re.compile(r'^([C,R,W,E,F].+):(\s+)?([0-9]+):?.*:\s(.*)$') for bufline in buf: bufline = bufline.rstrip() # remove trailing newline character @@ -66,8 +66,8 @@ def parsable_pylint(filename): error_list.append(code_line) code_line = {} - code_line['type'], code_line['lnum'], code_line['text'] = \ - error_re.match(bufline).groups() + (code_line['type'], _unused, code_line['lnum'], + code_line['text']) = error_re.match(bufline).groups() if carriage_re.match(bufline) and code_line: code_line['col'] = carriage_re.match(bufline).group().find('^') + 1 diff --git a/bundle/git_ctrlp/autoload/ctrlp.vim b/bundle/git_ctrlp/autoload/ctrlp.vim index f01f208..ba75c69 100644 --- a/bundle/git_ctrlp/autoload/ctrlp.vim +++ b/bundle/git_ctrlp/autoload/ctrlp.vim @@ -1303,8 +1303,17 @@ endf " *** Paths {{{2 " Line formatting {{{3 fu! s:formatline(str) - let cond = s:ispath && ( s:winw - 4 ) < s:strwidth(a:str) - retu '> '.( cond ? s:pathshorten(a:str) : a:str ) + let str = a:str + if s:itemtype == 1 + let bfnr = bufnr('^'.fnamemodify(str, ':p').'$') + let idc = ( bfnr == bufnr('#') ? '#' : '' ) + \ . ( getbufvar(bfnr, '&ma') ? '' : '-' ) + \ . ( getbufvar(bfnr, '&ro') ? '=' : '' ) + \ . ( getbufvar(bfnr, '&mod') ? '+' : '' ) + let str .= idc != '' ? ' '.idc : '' + en + let cond = s:ispath && ( s:winw - 4 ) < s:strwidth(str) + retu '> '.( cond ? s:pathshorten(str) : str ) endf fu! s:pathshorten(str) diff --git a/bundle/git_ctrlp/doc/ctrlp.txt b/bundle/git_ctrlp/doc/ctrlp.txt index 9431009..464a6ef 100644 --- a/bundle/git_ctrlp/doc/ctrlp.txt +++ b/bundle/git_ctrlp/doc/ctrlp.txt @@ -1157,8 +1157,8 @@ Highlighting:~ Statuslines:~ * Highlight groups: - CtrlPMode1 : 'prt' or 'win', also for 'regex' (Character) - CtrlPMode2 : 'file' or 'path', also for the local working dir (|hl-LineNr|) + CtrlPMode1 : 'file' or 'path', and the current mode (Character) + CtrlPMode2 : 'prt' or 'win', 'regex', the working directory (|hl-LineNr|) CtrlPStats : the scanning status (Function) For rebuilding the statuslines, see |g:ctrlp_status_func|. @@ -1240,6 +1240,7 @@ Special thanks:~ * Seth Fowler * Lowe Thiderman * Christopher Fredén + * Zahary Karadjov =============================================================================== CHANGELOG *ctrlp-changelog* diff --git a/bundle/git_syntastic/autoload/syntastic/c.vim b/bundle/git_syntastic/autoload/syntastic/c.vim index 8d32949..4353696 100644 --- a/bundle/git_syntastic/autoload/syntastic/c.vim +++ b/bundle/git_syntastic/autoload/syntastic/c.vim @@ -53,6 +53,17 @@ function! s:Unique(list) return l endfunction +" convenience function to determine the 'null device' parameter +" based on the current operating system +function! syntastic#c#GetNullDevice() + if has('win32') + return '-o nul' + elseif has('unix') || has('mac') + return '-o /dev/null' + endif + return '' +endfunction + " get the gcc include directory argument depending on the default " includes and the optional user-defined 'g:syntastic_c_include_dirs' function! syntastic#c#GetIncludeDirs(filetype) diff --git a/bundle/git_syntastic/plugin/syntastic.vim b/bundle/git_syntastic/plugin/syntastic.vim index 2cddcee..97cb346 100644 --- a/bundle/git_syntastic/plugin/syntastic.vim +++ b/bundle/git_syntastic/plugin/syntastic.vim @@ -19,10 +19,6 @@ let g:loaded_syntastic_plugin = 1 let s:running_windows = has("win16") || has("win32") -if !s:running_windows - let s:uname = system('uname') -endif - if !exists("g:syntastic_enable_signs") let g:syntastic_enable_signs = 1 endif @@ -58,6 +54,12 @@ if !exists("g:syntastic_enable_highlighting") let g:syntastic_enable_highlighting = 1 endif +" highlighting requires getmatches introduced in 7.1.040 +if g:syntastic_enable_highlighting == 1 && + \ (v:version < 701 || v:version == 701 && has('patch040')) + let g:syntastic_enable_highlighting = 1 +endif + if !exists("g:syntastic_echo_current_error") let g:syntastic_echo_current_error = 1 endif @@ -143,7 +145,7 @@ function! s:UpdateErrors(auto_invoked) endif if g:syntastic_enable_highlighting - call s:HightlightErrors() + call s:HighlightErrors() endif if g:syntastic_auto_jump && s:BufHasErrorsOrWarningsToDisplay() @@ -384,7 +386,7 @@ endfunction " "If the 'force_highlight_callback' key is set for an error item, then invoke "the callback even if it can be highlighted automatically. -function! s:HightlightErrors() +function! s:HighlightErrors() call s:ClearErrorHighlights() let fts = substitute(&ft, '-', '_', 'g') @@ -485,11 +487,18 @@ endfunction "shelling out to syntax checkers. Not all OSs support the hacks though function! s:OSSupportsShellpipeHack() if !exists("s:os_supports_shellpipe_hack") - let s:os_supports_shellpipe_hack = !s:running_windows && (s:uname !~ "FreeBSD") && (s:uname !~ "OpenBSD") + let s:os_supports_shellpipe_hack = !s:running_windows && (s:uname() !~ "FreeBSD") && (s:uname() !~ "OpenBSD") endif return s:os_supports_shellpipe_hack endfunction +function! s:uname() + if !exists('s:uname') + let s:uname = system('uname') + endif + return s:uname +endfunction + "check if a syntax checker exists for the given filetype - and attempt to "load one function! SyntasticCheckable(ft) @@ -500,6 +509,19 @@ function! SyntasticCheckable(ft) return exists("*SyntaxCheckers_". a:ft ."_GetLocList") endfunction +"the args must be arrays of the form [major, minor, macro] +function SyntasticIsVersionAtLeast(installed, required) + if a:installed[0] != a:required[0] + return a:installed[0] > a:required[0] + endif + + if a:installed[1] != a:required[1] + return a:installed[1] > a:required[1] + endif + + return a:installed[2] >= a:required[2] +endfunction + "return a string representing the state of buffer according to "g:syntastic_stl_format " diff --git a/bundle/git_syntastic/syntax_checkers/c.vim b/bundle/git_syntastic/syntax_checkers/c.vim index 55b06de..2a4b240 100644 --- a/bundle/git_syntastic/syntax_checkers/c.vim +++ b/bundle/git_syntastic/syntax_checkers/c.vim @@ -1,7 +1,7 @@ "============================================================================ "File: c.vim "Description: Syntax checking plugin for syntastic.vim -"Maintainer: Gregor Uhlenheuer +"Maintainer: Martin Grenfell "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 @@ -9,150 +9,31 @@ " See http://sam.zoy.org/wtfpl/COPYING for more details. " "============================================================================ - -" In order to also check header files add this to your .vimrc: -" (this usually creates a .gch file in your source directory) -" -" let g:syntastic_c_check_header = 1 -" -" To disable the search of included header files after special -" libraries like gtk and glib add this line to your .vimrc: -" -" let g:syntastic_c_no_include_search = 1 -" -" To enable header files being re-checked on every file write add the -" following line to your .vimrc. Otherwise the header files are checked only -" one time on initially loading the file. -" In order to force syntastic to refresh the header includes simply -" unlet b:syntastic_c_includes. Then the header files are being re-checked on -" the next file write. -" -" let g:syntastic_c_auto_refresh_includes = 1 -" -" Alternatively you can set the buffer local variable b:syntastic_c_cflags. -" If this variable is set for the current buffer no search for additional -" libraries is done. I.e. set the variable like this: -" -" let b:syntastic_c_cflags = ' -I/usr/include/libsoup-2.4' -" -" In order to add some custom include directories that should be added to the -" gcc command line you can add those to the global variable -" g:syntastic_c_include_dirs. This list can be used like this: -" -" let g:syntastic_c_include_dirs = [ 'includes', 'headers' ] -" -" Moreover it is possible to add additional compiler options to the syntax -" checking execution via the variable 'g:syntastic_c_compiler_options': -" -" let g:syntastic_c_compiler_options = ' -ansi' -" -" Additionally the setting 'g:syntastic_c_config_file' allows you to define a -" file that contains additional compiler arguments like include directories or -" CFLAGS. The file is expected to contain one option per line. If none is -" given the filename defaults to '.syntastic_c_config': -" -" let g:syntastic_c_config_file = '.config' -" -" Using the global variable 'g:syntastic_c_remove_include_errors' you can -" specify whether errors of files included via the g:syntastic_c_include_dirs' -" setting are removed from the result set: -" -" let g:syntastic_c_remove_include_errors = 1 -" -" Use the variable 'g:syntastic_c_errorformat' to override the default error -" format: -" -" let g:syntastic_c_errorformat = '%f:%l:%c: %trror: %m' - -if exists('loaded_c_syntax_checker') +if exists("loaded_c_syntax_checker") finish endif let loaded_c_syntax_checker = 1 -if !executable('gcc') - finish +if !exists('g:syntastic_c_checker') + let g:syntastic_c_checker = "gcc" endif -let s:save_cpo = &cpo -set cpo&vim - -if !exists('g:syntastic_c_compiler_options') - let g:syntastic_c_compiler_options = '-std=gnu99' +if g:syntastic_c_checker == "gcc" + if executable("gcc") + runtime! syntax_checkers/c/gcc.vim + endif +elseif g:syntastic_c_checker == "checkpatch" + if executable("checkpatch.pl") || executable("./scripts/checkpatch.pl") + runtime! syntax_checkers/c/checkpatch.vim + endif +elseif g:syntastic_c_checker == "checkpatch-kernel-only" + if executable("./scripts/checkpatch.pl") + runtime! syntax_checkers/c/checkpatch.vim + elseif executable("gcc") + runtime! syntax_checkers/c/gcc.vim + endif +elseif g:syntastic_c_checker == "sparse" + if executable("cgcc") + runtime! syntax_checkers/c/sparse.vim + endif endif - -if !exists('g:syntastic_c_config_file') - let g:syntastic_c_config_file = '.syntastic_c_config' -endif - -function! SyntaxCheckers_c_GetLocList() - let makeprg = 'gcc -fsyntax-only ' - let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '. - \ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '. - \ 'each function it appears%.%#,%-GIn file included%.%#,'. - \ '%-G %#from %f:%l\,,%f:%l:%c: %trror: %m,%f:%l:%c: '. - \ '%tarning: %m,%f:%l:%c: %m,%f:%l: %trror: %m,'. - \ '%f:%l: %tarning: %m,%f:%l: %m' - - if exists('g:syntastic_c_errorformat') - let errorformat = g:syntastic_c_errorformat - endif - - " add optional user-defined compiler options - let makeprg .= g:syntastic_c_compiler_options - - let makeprg .= ' '.shellescape(expand('%')). - \ ' '.syntastic#c#GetIncludeDirs('c') - - " determine whether to parse header files as well - if expand('%') =~? '.h$' - if exists('g:syntastic_c_check_header') - let makeprg = 'gcc -c '.shellescape(expand('%')). - \ ' '.syntastic#c#GetIncludeDirs('c') - else - return [] - endif - endif - - " check if the user manually set some cflags - if !exists('b:syntastic_c_cflags') - " check whether to search for include files at all - if !exists('g:syntastic_c_no_include_search') || - \ g:syntastic_c_no_include_search != 1 - " refresh the include file search if desired - if exists('g:syntastic_c_auto_refresh_includes') && - \ g:syntastic_c_auto_refresh_includes != 0 - let makeprg .= syntastic#c#SearchHeaders() - else - " search for header includes if not cached already - if !exists('b:syntastic_c_includes') - let b:syntastic_c_includes = syntastic#c#SearchHeaders() - endif - let makeprg .= b:syntastic_c_includes - endif - endif - else - " use the user-defined cflags - let makeprg .= b:syntastic_c_cflags - endif - - " add optional config file parameters - let makeprg .= ' '.syntastic#c#ReadConfig(g:syntastic_c_config_file) - - " process makeprg - let errors = SyntasticMake({ 'makeprg': makeprg, - \ 'errorformat': errorformat }) - - " filter the processed errors if desired - if exists('g:syntastic_c_remove_include_errors') && - \ g:syntastic_c_remove_include_errors != 0 - return filter(errors, - \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) - else - return errors - endif -endfunction - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim: set et sts=4 sw=4: diff --git a/bundle/git_syntastic/syntax_checkers/cpp.vim b/bundle/git_syntastic/syntax_checkers/cpp.vim index 8aae1fe..5b119fa 100644 --- a/bundle/git_syntastic/syntax_checkers/cpp.vim +++ b/bundle/git_syntastic/syntax_checkers/cpp.vim @@ -11,7 +11,6 @@ "============================================================================ " in order to also check header files add this to your .vimrc: -" (this usually creates a .gch file in your source directory) " " let g:syntastic_cpp_check_header = 1 " @@ -66,7 +65,7 @@ " " Set your compiler executable with e.g. (defaults to g++) " -" let g:syntastic_cpp_compiler = 'clang++' +" let g:syntastic_cpp_compiler = 'clang++' if exists('loaded_cpp_syntax_checker') finish @@ -77,6 +76,10 @@ if !exists('g:syntastic_cpp_compiler') let g:syntastic_cpp_compiler = 'g++' endif +if !exists('g:syntastic_cpp_compiler_options') + let g:syntastic_cpp_compiler_options = '' +endif + if !executable(g:syntastic_cpp_compiler) finish endif @@ -89,7 +92,8 @@ if !exists('g:syntastic_cpp_config_file') endif function! SyntaxCheckers_cpp_GetLocList() - let makeprg = g:syntastic_cpp_compiler . ' -fsyntax-only ' + let makeprg = g:syntastic_cpp_compiler . ' -fsyntax-only ' . + \ g:syntastic_cpp_compiler_options let errorformat = '%-G%f:%s:,%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: '. \ '%m,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %tarning: %m,'. \ '%f:%l: %m' @@ -98,16 +102,14 @@ function! SyntaxCheckers_cpp_GetLocList() let errorformat = g:syntastic_cpp_errorformat endif - if exists('g:syntastic_cpp_compiler_options') - let makeprg .= g:syntastic_cpp_compiler_options - endif - let makeprg .= ' ' . shellescape(expand('%')) . \ ' ' . syntastic#c#GetIncludeDirs('cpp') if expand('%') =~? '\%(.h\|.hpp\|.hh\)$' if exists('g:syntastic_cpp_check_header') - let makeprg = g:syntastic_cpp_compiler.' -c '.shellescape(expand('%')). + let makeprg = g:syntastic_cpp_compiler.' -c '.shellescape(expand('%')) . + \ ' ' . g:syntastic_cpp_compiler_options . + \ ' ' . syntastic#c#GetNullDevice() . \ ' ' . syntastic#c#GetIncludeDirs('cpp') else return [] diff --git a/bundle/git_syntastic/syntax_checkers/efm_perl.pl b/bundle/git_syntastic/syntax_checkers/efm_perl.pl index a193456..fe6b67d 100644 --- a/bundle/git_syntastic/syntax_checkers/efm_perl.pl +++ b/bundle/git_syntastic/syntax_checkers/efm_perl.pl @@ -92,13 +92,14 @@ my $handle = (defined $opt_f ? \*FILE : \*STDOUT); (my $file = shift) or &usage; # display usage if no filename is supplied my $args = (@ARGV ? ' ' . join ' ', @ARGV : ''); -my @error_lines = `perl @{[defined $opt_I ? "-I$opt_I" : '']} @{[defined $opt_c ? '-c ' : '' ]} @{[defined $opt_w ? '-X ' : '-w ']} "$file$args" 2>&1`; +my $libs = join ' ', map {"-I$_"} split ',', $opt_I; +my @error_lines = `perl $libs @{[defined $opt_c ? '-c ' : '' ]} @{[defined $opt_w ? '-X ' : '-w ']} "$file$args" 2>&1`; my @lines = map { "E:$_" } @error_lines; my @warn_lines; if(defined($opt_w)) { - @warn_lines = `perl @{[defined $opt_I ? $opt_I : '']} @{[defined $opt_c ? '-c ' : '' ]} -w "$file$args" 2>&1`; + @warn_lines = `perl $libs @{[defined $opt_c ? '-c ' : '' ]} -w "$file$args" 2>&1`; } # Any new errors must be warnings diff --git a/bundle/git_syntastic/syntax_checkers/erlang.vim b/bundle/git_syntastic/syntax_checkers/erlang.vim index d7dceae..6e57701 100644 --- a/bundle/git_syntastic/syntax_checkers/erlang.vim +++ b/bundle/git_syntastic/syntax_checkers/erlang.vim @@ -20,6 +20,10 @@ if !executable("escript") endif let s:check_file = expand(':p:h') . '/erlang_check_file.erl' +if !exists("g:syntastic_erlc_include_path") + let g:syntastic_erlc_include_path="" +endif + function! SyntaxCheckers_erlang_GetLocList() let extension = expand('%:e') @@ -31,10 +35,10 @@ function! SyntaxCheckers_erlang_GetLocList() if match(shebang, 'escript') >= 0 let makeprg = 'escript -s '.shellescape(expand('%:p')) else - let makeprg = s:check_file . ' '. shellescape(expand('%:p')) + let makeprg = s:check_file . ' '. shellescape(expand('%:p')).' '.g:syntastic_erlc_include_path endif else - let makeprg = s:check_file . ' ' . shellescape(expand('%:p')) + let makeprg = s:check_file . ' ' . shellescape(expand('%:p')).' '.g:syntastic_erlc_include_path endif let errorformat = '%f:%l:\ %tarning:\ %m,%E%f:%l:\ %m' diff --git a/bundle/git_syntastic/syntax_checkers/erlang_check_file.erl b/bundle/git_syntastic/syntax_checkers/erlang_check_file.erl index 8a85bf6..d2f4217 100755 --- a/bundle/git_syntastic/syntax_checkers/erlang_check_file.erl +++ b/bundle/git_syntastic/syntax_checkers/erlang_check_file.erl @@ -1,6 +1,10 @@ #!/usr/bin/env escript -export([main/1]). +main([FileName| LibDirs=[_|_]]) -> + code:add_pathsa(LibDirs), + main([FileName]); + main([FileName]) -> compile:file(FileName, [warn_obsolete_guard, warn_unused_import, diff --git a/bundle/git_syntastic/syntax_checkers/eruby.vim b/bundle/git_syntastic/syntax_checkers/eruby.vim index 52cec3a..a066d92 100644 --- a/bundle/git_syntastic/syntax_checkers/eruby.vim +++ b/bundle/git_syntastic/syntax_checkers/eruby.vim @@ -14,21 +14,24 @@ if exists("loaded_eruby_syntax_checker") endif let loaded_eruby_syntax_checker = 1 -"bail if the user doesnt have ruby or cat installed -if !executable("ruby") || !executable("cat") +"bail if the user doesnt have ruby installed +if !executable("ruby") finish endif function! SyntaxCheckers_eruby_GetLocList() + "gsub fixes issue #7 rails has it's own eruby syntax if has('win32') - let makeprg='sed "s/<\%=/<\%/g" '. shellescape(expand("%")) . ' \| ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| ruby -c' + let makeprg='ruby -rerb -e "puts ERB.new(File.read(''' . + \ (expand("%")) . + \ ''').gsub(''<\%='',''<\%''), nil, ''-'').src" \| ruby -c' else - let makeprg='sed "s/<\%=/<\%/g" '. shellescape(expand("%")) . ' \| RUBYOPT= ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| RUBYOPT= ruby -c' + let makeprg='RUBYOPT= ruby -rerb -e "puts ERB.new(File.read(''' . + \ (expand("%")) . + \ ''').gsub(''<\%='',''<\%''), nil, ''-'').src" \| RUBYOPT= ruby -c' endif let errorformat='%-GSyntax OK,%E-:%l: syntax error\, %m,%Z%p^,%W-:%l: warning: %m,%Z%p^,%-C%.%#' - return SyntasticMake({ 'makeprg': makeprg, - \ 'errorformat': errorformat, - \ 'defaults': {'bufnr': bufnr("")} }) + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat}) endfunction diff --git a/bundle/git_syntastic/syntax_checkers/java.vim b/bundle/git_syntastic/syntax_checkers/java.vim index 8d9b247..6a761c6 100644 --- a/bundle/git_syntastic/syntax_checkers/java.vim +++ b/bundle/git_syntastic/syntax_checkers/java.vim @@ -1,28 +1,23 @@ "============================================================================ "File: java.vim -"Description: Syntax checking plugin for syntastic.vim -"Maintainer: Jochen Keil +"Description: Figures out which java syntax checker (if any) to load +" from the java directory. +"Maintainer: Dmitry Geurkov "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. " +" Use g:syntastic_java_checker option to specify which java syntax checker +" should be used (see below for a list of supported checkers). +" If g:syntastic_java_checker is not set, just use the first syntax +" checker that we find installed. "============================================================================ -function! SyntaxCheckers_java_GetLocList() +if exists("loaded_java_syntax_checker") + finish +endif +let loaded_java_syntax_checker = 1 - let makeprg = 'javac -Xlint ' - \. expand ( '%:p:h' ) . '/' . expand ( '%:t' ) - \. ' 2>&1 \| ' - \. 'sed -e "s\|' - \. expand ( '%:t' ) - \. '\|' - \. expand ( '%:p:h' ) . '/' . expand ( '%:t' ) - \. '\|"' - - " unashamedly stolen from *errorformat-javac* (quickfix.txt) - let errorformat = '%A%f:%l:\ %m,%+Z%p^,%+C%.%#,%-G%.%#' - - return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) - -endfunction +let s:supported_checkers = ["javac", "checkstyle"] +call SyntasticLoadChecker(s:supported_checkers, 'java') diff --git a/bundle/git_syntastic/syntax_checkers/less.vim b/bundle/git_syntastic/syntax_checkers/less.vim index 1338ffd..e774ece 100644 --- a/bundle/git_syntastic/syntax_checkers/less.vim +++ b/bundle/git_syntastic/syntax_checkers/less.vim @@ -9,6 +9,14 @@ " See http://sam.zoy.org/wtfpl/COPYING for more details. " "============================================================================ + +" To send additional options to less use the variable g:syntastic_less_options. +" The default is +" let g:syntastic_less_options = "--no-color" +" +" To use less-lint instead of less set the variable +" g:syntastic_less_use_less_lint. + if exists("loaded_less_syntax_checker") finish endif @@ -23,13 +31,20 @@ if !exists("g:syntastic_less_options") let g:syntastic_less_options = "--no-color" endif -function! SyntaxCheckers_less_GetLocList() - let makeprg = 'lessc '. g:syntastic_less_options .' '. shellescape(expand('%')) . ' /dev/null' +if !exists("g:syntastic_less_use_less_lint") + let g:syntastic_less_use_less_lint = 0 +endif - "lessc >= 1.2 +if g:syntastic_less_use_less_lint + let s:check_file = 'node ' . expand(':p:h') . '/less-lint.js' +else + let s:check_file = 'lessc' +end + +function! SyntaxCheckers_less_GetLocList() + let makeprg = s:check_file . ' ' . g:syntastic_less_options . ' ' . + \ shellescape(expand('%')) . ' /dev/null' let errorformat = '%m in %f:%l:%c' - "lessc < 1.2 - let errorformat .= ', Syntax %trror on line %l in %f,Syntax %trror on line %l,! Syntax %trror: on line %l: %m,%-G%.%#' return SyntasticMake({ 'makeprg': makeprg, \ 'errorformat': errorformat, diff --git a/bundle/git_syntastic/syntax_checkers/php.vim b/bundle/git_syntastic/syntax_checkers/php.vim index a2c909d..5b9b116 100644 --- a/bundle/git_syntastic/syntax_checkers/php.vim +++ b/bundle/git_syntastic/syntax_checkers/php.vim @@ -40,8 +40,8 @@ function! SyntaxCheckers_php_GetLocList() let errors = [] - let makeprg = "php -l -d error_reporting=E_ALL -d display_errors=0 -d error_log='' ".shellescape(expand('%')) - let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l,PHP Parse %trror: %m in %f on line %l' + let makeprg = "php -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 ".shellescape(expand('%')) + let errorformat='%-GNo syntax errors detected in%.%#,Parse error: %#syntax %trror\ , %m in %f on line %l,Parse %trror: %m in %f on line %l,Fatal %trror: %m in %f on line %l,%-G\s%#,%-GErrors parsing %.%#' let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) if empty(errors) && !g:syntastic_phpcs_disable && executable("phpcs") diff --git a/bundle/git_syntastic/syntax_checkers/puppet.vim b/bundle/git_syntastic/syntax_checkers/puppet.vim index a675a83..e20cf2d 100644 --- a/bundle/git_syntastic/syntax_checkers/puppet.vim +++ b/bundle/git_syntastic/syntax_checkers/puppet.vim @@ -50,21 +50,8 @@ function! s:PuppetLintVersion() return s:puppet_lint_version endfunction -"the args must be arrays of the form [major, minor, macro] -function s:IsVersionAtLeast(installed, required) - if a:installed[0] != a:required[0] - return a:installed[0] > a:required[0] - endif - - if a:installed[1] != a:required[1] - return a:installed[1] > a:required[1] - endif - - return a:installed[2] >= a:required[2] -endfunction - if !g:syntastic_puppet_lint_disable - if !s:IsVersionAtLeast(s:PuppetLintVersion(), [0,1,10]) + if !SyntasticIsVersionAtLeast(s:PuppetLintVersion(), [0,1,10]) let g:syntastic_puppet_lint_disable = 1 endif end @@ -81,34 +68,37 @@ endfunction function! s:getPuppetMakeprg() "If puppet is >= version 2.7 then use the new executable - if s:IsVersionAtLeast(s:PuppetVersion(), [2,7,0]) + if SyntasticIsVersionAtLeast(s:PuppetVersion(), [2,7,0]) let makeprg = 'puppet parser validate ' . \ shellescape(expand('%')) . \ ' --color=false' - - "add --ignoreimport for versions < 2.7.10 - if s:PuppetVersion()[2] < '10' - let makeprg .= ' --ignoreimport' - endif - else - let makeprg = 'puppet --color=false --parseonly --ignoreimport '.shellescape(expand('%')) + let makeprg = 'puppet --color=false --parseonly '.shellescape(expand('%')) endif return makeprg endfunction +function! s:getPuppetEfm() + "some versions of puppet (e.g. 2.7.10) output the message below if there + "are any syntax errors + let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,' + let errorformat .= 'err: Could not parse for environment %*[a-z]: %m at %f:%l' + + "Puppet 3.0.0 changes this from "err:" to "Error:" + "reset errorformat in that case + if SyntasticIsVersionAtLeast(s:PuppetVersion(), [3,0,0]) + let errorformat = '%-GError: Try ''puppet help parser validate'' for usage,' + let errorformat .= 'Error: Could not parse for environment %*[a-z]: %m at %f:%l' + endif + + return errorformat +endfunction + function! SyntaxCheckers_puppet_GetLocList() let errors = [] if !g:syntastic_puppet_validate_disable - let makeprg = s:getPuppetMakeprg() - - "some versions of puppet (e.g. 2.7.10) output the message below if there - "are any syntax errors - let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,' - let errorformat .= 'err: Could not parse for environment %*[a-z]: %m at %f:%l' - - let errors = errors + SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + let errors = errors + SyntasticMake({ 'makeprg': s:getPuppetMakeprg(), 'errorformat': s:getPuppetEfm() }) endif if !g:syntastic_puppet_lint_disable diff --git a/bundle/git_syntastic/syntax_checkers/ruby.vim b/bundle/git_syntastic/syntax_checkers/ruby.vim index aab7c6b..7107311 100644 --- a/bundle/git_syntastic/syntax_checkers/ruby.vim +++ b/bundle/git_syntastic/syntax_checkers/ruby.vim @@ -18,15 +18,6 @@ if exists("loaded_ruby_syntax_checker") endif let loaded_ruby_syntax_checker = 1 -if !exists("g:syntastic_ruby_exec") - let g:syntastic_ruby_exec = "ruby" -endif - -"bail if the user doesnt have ruby installed where they said it is -if !executable(expand(g:syntastic_ruby_exec)) - finish -endif - if !exists("g:syntastic_ruby_checker") let g:syntastic_ruby_checker = "mri" endif diff --git a/bundle/git_syntastic/syntax_checkers/ruby/mri.vim b/bundle/git_syntastic/syntax_checkers/ruby/mri.vim index 42a7770..d2f9333 100644 --- a/bundle/git_syntastic/syntax_checkers/ruby/mri.vim +++ b/bundle/git_syntastic/syntax_checkers/ruby/mri.vim @@ -9,6 +9,23 @@ " See http://sam.zoy.org/wtfpl/COPYING for more details. " "============================================================================ +function! s:FindRubyExec() + if executable("rvm") + return system("rvm tools identifier") + endif + + return "ruby" +endfunction + +if !exists("g:syntastic_ruby_exec") + let g:syntastic_ruby_exec = s:FindRubyExec() +endif + +"bail if the user doesnt have ruby installed where they said it is +if !executable(expand(g:syntastic_ruby_exec)) + finish +endif + function! SyntaxCheckers_ruby_GetLocList() let makeprg = expand(g:syntastic_ruby_exec).' -w -T1 -c '.shellescape(expand('%')) if !has('win32') @@ -24,6 +41,12 @@ function! SyntaxCheckers_ruby_GetLocList() "the word "possibly" in the warning let errorformat = '%-G%.%#warning: %\(possibly %\)%\?useless use of == in void context' - let errorformat .= ',%-GSyntax OK,%E%f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#' + " 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%f:%l: syntax error\, %m' + let errorformat .= ',%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#' return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) endfunction diff --git a/bundle/git_syntastic/syntax_checkers/sass.vim b/bundle/git_syntastic/syntax_checkers/sass.vim index f475841..b67ed23 100644 --- a/bundle/git_syntastic/syntax_checkers/sass.vim +++ b/bundle/git_syntastic/syntax_checkers/sass.vim @@ -19,6 +19,11 @@ if !executable("sass") finish endif +"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 +endif + "use compass imports if available let s:imports = "" if executable("compass") @@ -26,6 +31,9 @@ if executable("compass") endif function! SyntaxCheckers_sass_GetLocList() + if !g:syntastic_sass_check_partials && expand('%:t')[0] == '_' + return [] + end let makeprg='sass --no-cache '.s:imports.' --check '.shellescape(expand('%')) let errorformat = '%ESyntax %trror:%m,%C on line %l of %f,%Z%.%#' let errorformat .= ',%Wwarning on line %l:,%Z%m,Syntax %trror on line %l: %m' diff --git a/bundle/git_tagbar/autoload/tagbar.vim b/bundle/git_tagbar/autoload/tagbar.vim index b852099..e9e8e93 100644 --- a/bundle/git_tagbar/autoload/tagbar.vim +++ b/bundle/git_tagbar/autoload/tagbar.vim @@ -1712,8 +1712,6 @@ function! s:InitWindow(autoclose) abort setlocal nowrap setlocal winfixwidth setlocal textwidth=0 - setlocal nocursorline - setlocal nocursorcolumn setlocal nospell if exists('+relativenumber') @@ -2501,7 +2499,8 @@ function! s:PrintKinds(typeinfo, fileinfo) abort " only if they are not scope-defining tags (since " those already have an identifier) if !has_key(a:typeinfo.kind2scope, ckind.short) - silent put =' [' . ckind.long . ']' + silent put =repeat(' ', g:tagbar_indent + 2) . + \ '[' . ckind.long . ']' " Add basic tag to allow folding when on the " header line let headertag = s:BaseTag.New(ckind.long) @@ -2546,7 +2545,7 @@ function! s:PrintKinds(typeinfo, fileinfo) abort if !kindtag.isFolded() for tag in curtags let str = tag.strfmt() - silent put =' ' . str + silent put =repeat(' ', g:tagbar_indent) . str " Save the current tagbar line in the tag for easy " highlighting access @@ -2569,7 +2568,7 @@ endfunction " s:PrintTag() {{{2 function! s:PrintTag(tag, depth, fileinfo, typeinfo) abort " Print tag indented according to depth - silent put =repeat(' ', a:depth * 2) . a:tag.strfmt() + silent put =repeat(' ', a:depth * g:tagbar_indent) . a:tag.strfmt() " Save the current tagbar line in the tag for easy " highlighting access @@ -2587,8 +2586,8 @@ function! s:PrintTag(tag, depth, fileinfo, typeinfo) abort " are not scope-defining tags (since those already have an " identifier) if !has_key(a:typeinfo.kind2scope, ckind.short) - silent put =' ' . repeat(' ', a:depth * 2) . - \ '[' . ckind.long . ']' + silent put =repeat(' ', (a:depth + 1) * g:tagbar_indent + 2) + \ . '[' . ckind.long . ']' " Add basic tag to allow folding when on the header line let headertag = s:BaseTag.New(ckind.long) let headertag.parent = a:tag diff --git a/bundle/git_tagbar/doc/tagbar.txt b/bundle/git_tagbar/doc/tagbar.txt index 2adb476..ed564f8 100644 --- a/bundle/git_tagbar/doc/tagbar.txt +++ b/bundle/git_tagbar/doc/tagbar.txt @@ -408,6 +408,18 @@ Example: let g:tagbar_compact = 1 < + *g:tagbar_indent* +g:tagbar_indent~ +Default: 2 + +The number of spaces by which each level is indented. This allows making the +display more compact or more spacious. + +Example: +> + let g:tagbar_indent = 1 +< + *g:tagbar_expand* g:tagbar_expand~ Default: 0 diff --git a/bundle/git_tagbar/plugin/tagbar.vim b/bundle/git_tagbar/plugin/tagbar.vim index ad7c3c8..6e04099 100644 --- a/bundle/git_tagbar/plugin/tagbar.vim +++ b/bundle/git_tagbar/plugin/tagbar.vim @@ -66,6 +66,10 @@ if !exists('g:tagbar_compact') let g:tagbar_compact = 0 endif +if !exists('g:tagbar_indent') + let g:tagbar_indent = 2 +endif + if !exists('g:tagbar_expand') let g:tagbar_expand = 0 endif