mirror of
https://github.com/amix/vimrc
synced 2025-06-24 07:44:59 +08:00
Updated vimrc
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_php_php_checker")
|
||||
if exists('g:loaded_syntastic_php_php_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_php_checker = 1
|
||||
@ -20,7 +20,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_php_php_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], "\\munexpected '\\zs[^']\\+\\ze'")
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
return term !=# '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_php_GetLocList() dict
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_php_phpcs_checker")
|
||||
if exists('g:loaded_syntastic_php_phpcs_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_phpcs_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_php_phplint_checker")
|
||||
if exists('g:loaded_syntastic_php_phplint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_phplint_checker = 1
|
||||
@ -20,31 +20,31 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_php_phplint_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
if term != ''
|
||||
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 != ''
|
||||
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 != ''
|
||||
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 != ''
|
||||
if term !=# ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
return term !=# '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phplint_GetLocList() dict
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_php_phpmd_checker")
|
||||
if exists('g:loaded_syntastic_php_phpmd_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_phpmd_checker = 1
|
||||
@ -20,35 +20,35 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\m\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C^The \S\+ \(\w\+\)\(()\)\= .*', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C^Avoid \(variables with short\|excessively long variable\) names like \S\+\.')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C^Avoid \(variables with short\|excessively long variable\) names like \(\S\+\)\..*', '\2', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C^Avoid using short method names like \S\+::\S\+()\.')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C^Avoid using short method names like \S\+::\(\S\+\)()\..*', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C^\S\+ accesses the super-global variable ')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C accesses the super-global variable .*$', '', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C^Constant \S\+ should be defined in uppercase')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C^Constant \(\S\+\) should be defined in uppercase', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], "\\m\\C^The '\\S\\+()' method which returns ")
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, "\\m\\C^The '\\(\\S\\+\\)()' method which returns.*", '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C variable \S\+ should begin with ')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C.* variable \(\S\+\) should begin with .*', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], "\\m\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\S\\+'")
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, "\\m\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\(\\S\\+\\)'.*", '\2', '')
|
||||
endif
|
||||
return ''
|
||||
|
Reference in New Issue
Block a user