mirror of
https://github.com/gryf/.vim.git
synced 2025-12-18 03:50:30 +01:00
Update of plugins: mark, ctrlp, taglisttoo and syntastic
This commit is contained in:
@@ -65,6 +65,41 @@ function! syntastic#c#GetIncludeDirs(filetype)
|
||||
return join(map(s:Unique(include_dirs), '"-I" . v:val'), ' ')
|
||||
endfunction
|
||||
|
||||
" read additional compiler flags from the given configuration file
|
||||
" the file format and its parsing mechanism is inspired by clang_complete
|
||||
function! syntastic#c#ReadConfig(file)
|
||||
" search in the current file's directory upwards
|
||||
let config = findfile(a:file, '.;')
|
||||
if config == '' || !filereadable(config) | return '' | endif
|
||||
|
||||
" convert filename into absolute path
|
||||
let filepath = substitute(fnamemodify(config, ':p:h'), '\', '/', 'g')
|
||||
|
||||
" try to read config file
|
||||
try
|
||||
let lines = map(readfile(config),
|
||||
\ 'substitute(v:val, ''\'', ''/'', ''g'')')
|
||||
catch /E484/
|
||||
return ''
|
||||
endtry
|
||||
|
||||
let parameters = []
|
||||
for line in lines
|
||||
let matches = matchlist(line, '^\s*-I\s*\(\S\+\)')
|
||||
if matches != [] && matches[1] != ''
|
||||
" this one looks like an absolute path
|
||||
if match(matches[1], '^\%(/\|\a:\)') != -1
|
||||
call add(parameters, '-I' . matches[1])
|
||||
else
|
||||
call add(parameters, '-I' . filepath . '/' . matches[1])
|
||||
endif
|
||||
else
|
||||
call add(parameters, line)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return join(parameters, ' ')
|
||||
endfunction
|
||||
|
||||
" search the first 100 lines for include statements that are
|
||||
" given in the handlers dictionary
|
||||
|
||||
@@ -46,6 +46,13 @@
|
||||
"
|
||||
" 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:
|
||||
@@ -68,6 +75,10 @@ if !exists('g:syntastic_c_compiler_options')
|
||||
let g:syntastic_c_compiler_options = '-std=gnu99'
|
||||
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 '.
|
||||
@@ -113,6 +124,9 @@ function! SyntaxCheckers_c_GetLocList()
|
||||
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 })
|
||||
|
||||
@@ -46,6 +46,13 @@
|
||||
"
|
||||
" let g:syntastic_cpp_compiler_options = ' -std=c++0x'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_cpp_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_cpp_config':
|
||||
"
|
||||
" let g:syntastic_cpp_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can
|
||||
" specify whether errors of files included via the
|
||||
" g:syntastic_cpp_include_dirs' setting are removed from the result set:
|
||||
@@ -64,6 +71,10 @@ endif
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_cpp_config_file')
|
||||
let g:syntastic_cpp_config_file = '.syntastic_cpp_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_GetLocList()
|
||||
let makeprg = 'g++ -fsyntax-only '
|
||||
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
|
||||
@@ -101,6 +112,9 @@ function! SyntaxCheckers_cpp_GetLocList()
|
||||
let makeprg .= b:syntastic_cpp_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= syntastic#c#ReadConfig(g:syntastic_cpp_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
@@ -19,11 +19,16 @@ if !executable("ghc-mod")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_haskell_checker_args')
|
||||
let g:syntastic_haskell_checker_args = '--hlintOpt="--language=XmlSyntax"'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_haskell_GetLocList()
|
||||
let ghcmod = 'ghc-mod ' . g:syntastic_haskell_checker_args
|
||||
let makeprg =
|
||||
\ "{ ".
|
||||
\ "ghc-mod check ". shellescape(expand('%')) . "; " .
|
||||
\ "ghc-mod lint " . shellescape(expand('%')) . ";" .
|
||||
\ ghcmod . " check ". shellescape(expand('%')) . "; " .
|
||||
\ ghcmod . " lint " . shellescape(expand('%')) . ";" .
|
||||
\ " }"
|
||||
let errorformat = '%-G\\s%#,%f:%l:%c:%trror: %m,%f:%l:%c:%tarning: %m,'.
|
||||
\ '%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%f:%l:%c:%m,'.
|
||||
|
||||
@@ -40,7 +40,7 @@ function! SyntaxCheckers_php_GetLocList()
|
||||
|
||||
let errors = []
|
||||
|
||||
let makeprg = "php -l -d error_reporting=E_PARSE -d display_errors=0 -d error_log='' ".shellescape(expand('%'))
|
||||
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'
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
|
||||
|
||||
@@ -26,6 +26,6 @@ endfunction
|
||||
|
||||
function! SyntaxCheckers_python_GetLocList()
|
||||
let makeprg = 'flake8 '.g:syntastic_python_checker_args.' '.shellescape(expand('%'))
|
||||
let errorformat = '%E%f:%l: could not compile,%-Z%p^,%W%f:%l:%c: %m,%W%f:%l: %m,%-G%.%#'
|
||||
let errorformat = '%E%f:%l: could not compile,%-Z%p^,%E%f:%l:%c: %m,%E%f:%l: %m,%-G%.%#'
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user