syntastic


vim-syntastic

pylint | eslint | phpqa--php+phpcs+phpmd


Eslint配置实战

myvim

Using Vim as a PHP IDE

Universal Ctags

universal-ctags download

提高阅读代码效率神器 Sourcetrail

vim插件: syntastic[语法检查]

dense-analysis GIT

ale

let g:ale_php_phan_minimum_severity = get(g:, 'ale_php_phan_minimum_severity', 0)

let g:ale_linters = {'php': ['php', 'langserver', 'phan']}

https://albert.cx/20190104-vim-for-php-development

Syntastic配置

et g:syntastic_enable_highlighting = 1 " 错误单词高亮
let g:syntastic_aggregate_errors = 1 "第一时间检查发现任何错误
let g:syntastic_enable_signs = 1 
let g:syntastic_auto_loc_list = 1 
let g:syntastic_check_on_open = 1 
let g:syntastic_check_on_wq = 0 
let g:syntastic_always_populate_loc_list = 1 
let g:syntastic_stl_format = "[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]"
let g:syntastic_debug_file = "~/syntastic.log"
" let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_checkers = ['gcc']

let g:syntastic_auto_jump = 1
let g:syntastic_enable_balloons = 1

let g:syntastic_cpp_compiler = 'g++'
let g:syntastic_cpp_compiler_options = '-std=c++11 -Wall -Wextra'

let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_auto_refresh_includes = 1

let g:syntastic_c_config_file = ['/home/howard/qt/qt-embedded-4.8.5/include/QtGui']
let g:syntastic_cpp_include_dirs = [
            \ '/home/howard/qt/qt-embedded-4.8.5/include/QtCore',
            \ '/home/howard/qt/qt-embedded-4.8.5/include/QtGui',
            \ '/usr/lib/llvm-3.8/include/llvm',
            \ '/usr/include/c++/5',
            \ '/usr/lib/llvm-3.8/lib/clang/3.8.0/include' ]

let g:syntastic_ignore_files=[".*\.py$", ".*\.S$"] "让 syntastic忽略 python 文件,和汇编文件
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"]
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

" YouCompleteMe options 这个自动补全的也有语法检测,需要关闭它的,配置如下
let g:ycm_enable_diagnostic_signs = 1 "诊断症状使能
let g:ycm_enable_diagnostic_highlighting = 0 "诊断语法彩笔做标记
let g:ycm_register_as_syntastic_checker = 1 " 使用syntastic检测语法
let g:ycm_error_symbol = '乄'
let g:ycm_warning_symbol = '〇'
" 这样配置就完美了,乄表示错误提示,而且这里配置了syntastic的检测,YCM是对python语法检测,对C++很多bug。

用Vim写Vue

定制

autocmd FileType vue syntax sync fromstart

au BufNewFile,BufRead *.html,*.js,*.vue set tabstop=2
au BufNewFile,BufRead *.html,*.js,*.vue set softtabstop=2
au BufNewFile,BufRead *.html,*.js,*.vue set shiftwidth=2
au BufNewFile,BufRead *.html,*.js,*.vue set expandtab
au BufNewFile,BufRead *.html,*.js,*.vue set autoindent
au BufNewFile,BufRead *.html,*.js,*.vue set fileformat=unix

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

let g:syntastic_javascript_checkers = ['eslint']

打开一个vue文件,输入命令:
:SyntasticInfo

npm install eslint eslint-plugin-vue