mirror of
https://github.com/amix/vimrc
synced 2025-08-16 20:55:00 +08:00
Updated plugins. Removed the tabstop merge that 010c2940ce
introduced
This commit is contained in:
@ -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 ' .
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user