mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated Vim plugins
This commit is contained in:
5
sources_non_forked/ale/ale_linters/php/cspell.vim
Normal file
5
sources_non_forked/ale/ale_linters/php/cspell.vim
Normal file
@ -0,0 +1,5 @@
|
||||
scriptencoding utf-8
|
||||
" Author: David Houston <houstdav000>
|
||||
" Description: cspell support for PHP files.
|
||||
|
||||
call ale#handlers#cspell#DefineLinter('php')
|
23
sources_non_forked/ale/ale_linters/php/phpactor.vim
Normal file
23
sources_non_forked/ale/ale_linters/php/phpactor.vim
Normal file
@ -0,0 +1,23 @@
|
||||
" Author: Arizard <https://github.com/Arizard>
|
||||
" Description: PHPactor integration for ALE
|
||||
|
||||
" Copied from langserver.vim
|
||||
function! ale_linters#php#phpactor#GetProjectRoot(buffer) abort
|
||||
let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
|
||||
|
||||
if (!empty(l:composer_path))
|
||||
return fnamemodify(l:composer_path, ':h')
|
||||
endif
|
||||
|
||||
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||
|
||||
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phpactor',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': 'phpactor',
|
||||
\ 'command': '%e language-server',
|
||||
\ 'project_root': function('ale_linters#php#phpactor#GetProjectRoot'),
|
||||
\})
|
Reference in New Issue
Block a user