mirror of
https://github.com/amix/vimrc
synced 2025-08-30 02:44:59 +08:00
Updated plugins
This commit is contained in:
13
sources_non_forked/ale/ale_linters/nix/deadnix.vim
Normal file
13
sources_non_forked/ale/ale_linters/nix/deadnix.vim
Normal file
@ -0,0 +1,13 @@
|
||||
call ale#Set('nix_deadnix_executable', 'deadnix')
|
||||
call ale#Set('nix_deadnix_options', '')
|
||||
|
||||
function! ale_linters#nix#deadnix#GetCommand(buffer) abort
|
||||
return '%e -o json' . ale#Pad(ale#Var(a:buffer, 'nix_deadnix_options')) . ' -- %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('nix', {
|
||||
\ 'name': 'deadnix',
|
||||
\ 'executable': {b -> ale#Var(b, 'nix_deadnix_executable')},
|
||||
\ 'command': function('ale_linters#nix#deadnix#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#deadnix#Handle',
|
||||
\})
|
@ -5,10 +5,10 @@
|
||||
function! ale_linters#nix#nix#Command(buffer, output, meta) abort
|
||||
let l:version = a:output[0][22:]
|
||||
|
||||
if l:version =~# '^\(2.[4-9]\|3\).*'
|
||||
return 'nix-instantiate --log-format internal-json --parse -'
|
||||
else
|
||||
if l:version =~# '^\(1\|2.[0-3]\.\).*'
|
||||
return 'nix-instantiate --parse -'
|
||||
else
|
||||
return 'nix-instantiate --log-format internal-json --parse -'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
Reference in New Issue
Block a user