1
0
mirror of https://github.com/amix/vimrc synced 2025-07-26 14:35:00 +08:00

Merge branch 'Linux' of https://github.com/Geezus42/vimrc into Linux

This commit is contained in:
geezus
2021-06-30 13:19:18 -05:00
235 changed files with 6246 additions and 1351 deletions

View File

@ -1,4 +1,5 @@
" Author: jD91mZM2 <me@krake.one>
<<<<<<< HEAD
function! ale_linters#json#jq#GetCommand(buffer) abort
let l:executable = ale#fixers#jq#GetExecutable(a:buffer)
@ -21,12 +22,34 @@ function! ale_linters#json#jq#Handle(buffer, lines) abort
endfor
return l:output
=======
call ale#Set('json_jq_executable', 'jq')
call ale#Set('json_jq_options', '')
call ale#Set('json_jq_filters', '.')
" Matches patterns like the following:
" parse error: Expected another key-value pair at line 4, column 3
let s:pattern = '^parse error: \(.\+\) at line \(\d\+\), column \(\d\+\)$'
function! ale_linters#json#jq#Handle(buffer, lines) abort
return ale#util#MapMatches(a:lines, s:pattern, {match -> {
\ 'text': match[1],
\ 'lnum': match[2] + 0,
\ 'col': match[3] + 0,
\}})
>>>>>>> 1cca3b1df2973096bb9526a0d79c7b93c04e66b3
endfunction
call ale#linter#Define('json', {
\ 'name': 'jq',
<<<<<<< HEAD
\ 'executable': function('ale#fixers#jq#GetExecutable'),
\ 'output_stream': 'stderr',
\ 'command': function('ale_linters#json#jq#GetCommand'),
=======
\ 'executable': {b -> ale#Var(b, 'json_jq_executable')},
\ 'output_stream': 'stderr',
\ 'command': '%e',
>>>>>>> 1cca3b1df2973096bb9526a0d79c7b93c04e66b3
\ 'callback': 'ale_linters#json#jq#Handle',
\})

View File

@ -4,7 +4,7 @@ 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', [
return ale#path#FindExecutable(a:buffer, 'json_jsonlint', [
\ 'node_modules/.bin/jsonlint',
\ 'node_modules/jsonlint/lib/cli.js',
\])

View File

@ -6,7 +6,11 @@ call ale#Set('json_spectral_use_global', get(g:, 'ale_use_global_executables', 0
call ale#linter#Define('json', {
\ 'name': 'spectral',
<<<<<<< HEAD
\ 'executable': {b -> ale#node#FindExecutable(b, 'json_spectral', [
=======
\ 'executable': {b -> ale#path#FindExecutable(b, 'json_spectral', [
>>>>>>> 1cca3b1df2973096bb9526a0d79c7b93c04e66b3
\ 'node_modules/.bin/spectral',
\ ])},
\ 'command': '%e lint --ignore-unknown-format -q -f text %t',