1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated plugins

This commit is contained in:
Amir Salihefendic
2019-03-27 16:08:56 +01:00
parent bf7b5985f1
commit 5a2572df03
73 changed files with 1924 additions and 598 deletions

View File

@ -37,11 +37,22 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort
return l:output
endfunction
function! ale_linters#elixir#credo#GetMode() abort
if get(g:, 'ale_elixir_credo_strict', 0)
return '--strict'
else
return 'suggest'
endif
endfunction
function! ale_linters#elixir#credo#GetCommand(buffer) abort
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
let l:mode = ale_linters#elixir#credo#GetMode()
return ale#path#CdString(l:project_root)
\ . ' mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s'
\ . 'mix help credo && '
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
\ . ' --format=flycheck --read-from-stdin %s'
endfunction
call ale#linter#Define('elixir', {

View File

@ -0,0 +1,22 @@
" Author: antew - https://github.com/antew
" Description: LSP integration for elm, currently supports diagnostics (linting)
call ale#Set('elm_lsp_executable', 'elm-lsp')
call ale#Set('elm_lsp_use_global', get(g:, 'ale_use_global_executables', 0))
function! elm_lsp#GetRootDir(buffer) abort
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')
return !empty(l:elm_json) ? fnamemodify(l:elm_json, ':p:h') : ''
endfunction
call ale#linter#Define('elm', {
\ 'name': 'elm_lsp',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#node#FindExecutable(b, 'elm_lsp', [
\ 'node_modules/.bin/elm-lsp',
\ ])},
\ 'command': '%e --stdio',
\ 'project_root': function('elm_lsp#GetRootDir'),
\ 'language': 'elm'
\})

View File

@ -1,4 +1,21 @@
" Author: KabbAmine <amine.kabb@gmail.com>
" Author: KabbAmine <amine.kabb@gmail.com>, David Sierra <https://github.com/davidsierradz>
call ale#Set('json_jsonlint_executable', 'jsonlint')
call ale#Set('json_jsonlint_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#json#jsonlint#GetExecutable(buffer) abort
return ale#node#FindExecutable(a:buffer, 'json_jsonlint', [
\ 'node_modules/.bin/jsonlint',
\ 'node_modules/jsonlint/lib/cli.js',
\])
endfunction
function! ale_linters#json#jsonlint#GetCommand(buffer) abort
let l:executable = ale_linters#json#jsonlint#GetExecutable(a:buffer)
return ale#node#Executable(a:buffer, l:executable)
\ . ' --compact -'
endfunction
function! ale_linters#json#jsonlint#Handle(buffer, lines) abort
" Matches patterns like the following:
@ -19,8 +36,8 @@ endfunction
call ale#linter#Define('json', {
\ 'name': 'jsonlint',
\ 'executable': 'jsonlint',
\ 'executable': function('ale_linters#json#jsonlint#GetExecutable'),
\ 'output_stream': 'stderr',
\ 'command': 'jsonlint --compact -',
\ 'command': function('ale_linters#json#jsonlint#GetCommand'),
\ 'callback': 'ale_linters#json#jsonlint#Handle',
\})

View File

@ -0,0 +1,5 @@
" Author: Vincent (wahrwolf [ät] wolfpit.net)
" Description: languagetool for mails
call ale#handlers#languagetool#DefineLinter('mail')

View File

@ -0,0 +1,5 @@
" Author: Vincent (wahrwolf [ät] wolfpit.net)
" Description: languagetool for markdown files
call ale#handlers#languagetool#DefineLinter('markdown')

View File

@ -5,6 +5,12 @@ call ale#Set('php_langserver_executable', 'php-language-server.php')
call ale#Set('php_langserver_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#php#langserver#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') : ''

View File

@ -0,0 +1,4 @@
" Author: Vincent (wahrwolf [ät] wolfpit.net)
" Description: languagetool for text files
call ale#handlers#languagetool#DefineLinter('text')