mirror of
https://github.com/amix/vimrc
synced 2025-06-24 07:44:59 +08:00
Updated vimrc
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_flake8_checker")
|
||||
if exists('g:loaded_syntastic_python_flake8_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_flake8_checker = 1
|
||||
|
@ -36,17 +36,17 @@ function! SyntaxCheckers_python_frosted_GetLocList() dict
|
||||
\ 'returns': [0, 1] })
|
||||
|
||||
for e in loclist
|
||||
let e["col"] += 1
|
||||
let e['col'] += 1
|
||||
|
||||
let parts = matchlist(e.text, '\v^([EW]\d+):([^:]*):(.+)')
|
||||
if len(parts) >= 4
|
||||
let e["type"] = parts[1][0]
|
||||
let e["text"] = parts[3] . ' [' . parts[1] . ']'
|
||||
let e["hl"] = '\V\<' . escape(parts[2], '\') . '\>'
|
||||
elseif e["text"] =~? '\v^I\d+:'
|
||||
let e["valid"] = 0
|
||||
let e['type'] = parts[1][0]
|
||||
let e['text'] = parts[3] . ' [' . parts[1] . ']'
|
||||
let e['hl'] = '\V\<' . escape(parts[2], '\') . '\>'
|
||||
elseif e['text'] =~? '\v^I\d+:'
|
||||
let e['valid'] = 0
|
||||
else
|
||||
let e["vcol"] = 0
|
||||
let e['vcol'] = 0
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_mypy_checker")
|
||||
if exists('g:loaded_syntastic_python_mypy_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_mypy_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_pep8_checker")
|
||||
if exists('g:loaded_syntastic_python_pep8_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_pep8_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_prospector_checker")
|
||||
if exists('g:loaded_syntastic_python_prospector_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_prospector_checker = 1
|
||||
|
@ -5,7 +5,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_py3kwarn_checker")
|
||||
if exists('g:loaded_syntastic_python_py3kwarn_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_py3kwarn_checker = 1
|
||||
|
@ -7,7 +7,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_pyflakes_checker")
|
||||
if exists('g:loaded_syntastic_python_pyflakes_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_pyflakes_checker = 1
|
||||
@ -27,12 +27,12 @@ function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i)
|
||||
|
||||
" fun with Python's %r: try "..." first, then '...'
|
||||
let term = matchstr(a:i['text'], '\m^.\{-}"\zs.\{-1,}\ze"')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V\<' . escape(term, '\') . '\>'
|
||||
endif
|
||||
|
||||
let term = matchstr(a:i['text'], '\m^.\{-}''\zs.\{-1,}\ze''')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V\<' . escape(term, '\') . '\>'
|
||||
endif
|
||||
endif
|
||||
@ -55,7 +55,7 @@ function! SyntaxCheckers_python_pyflakes_GetLocList() dict
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'env': env,
|
||||
\ 'defaults': {'text': "Syntax error"} })
|
||||
\ 'defaults': {'text': 'Syntax error'} })
|
||||
|
||||
for e in loclist
|
||||
let e['vcol'] = 0
|
||||
|
@ -27,7 +27,12 @@ function! SyntaxCheckers_python_pylama_GetHighlightRegex(item)
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pylama_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '-f pep8' })
|
||||
if !exists('s:pylama_new')
|
||||
let s:pylama_new = syntastic#util#versionIsAtLeast(self.getVersion(), [4])
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '-f pep8' . (s:pylama_new ? ' --force' : '') })
|
||||
|
||||
" TODO: "WARNING:pylama:..." messages are probably a logging bug
|
||||
let errorformat =
|
||||
|
@ -1,11 +1,11 @@
|
||||
"============================================================================
|
||||
"File: pylint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Author: Parantapa Bhattacharya <parantapa at gmail dot com>
|
||||
"Maintainer: Parantapa Bhattacharya <parantapa at gmail dot com>
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_pylint_checker")
|
||||
if exists('g:loaded_syntastic_python_pylint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_pylint_checker = 1
|
||||
@ -32,13 +32,14 @@ function! SyntaxCheckers_python_pylint_IsAvailable() dict
|
||||
" 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(syntastic#util#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.setVersion(ver)
|
||||
let version_output = syntastic#util#system(self.getExecEscaped() . ' --version')
|
||||
let pylint_version = filter( split(version_output, '\m, \=\|\n'), 'v:val =~# ''\m^\(python[-0-9]*-\|\.\)\=pylint[-0-9]*\>''' )[0]
|
||||
let parsed_ver = syntastic#util#parseVersion(substitute(pylint_version, '\v^\S+\s+', '', ''))
|
||||
call self.setVersion(parsed_ver)
|
||||
|
||||
let s:pylint_new = syntastic#util#versionIsAtLeast(ver, [1])
|
||||
let s:pylint_new = syntastic#util#versionIsAtLeast(parsed_ver, [1])
|
||||
catch /\m^Vim\%((\a\+)\)\=:E684/
|
||||
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1))
|
||||
call syntastic#log#error("checker python/pylint: can't parse version string (abnormal termination?)")
|
||||
let s:pylint_new = -1
|
||||
endtry
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_python_checker")
|
||||
if exists('g:loaded_syntastic_python_python_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_python_checker = 1
|
||||
|
Reference in New Issue
Block a user