forked from amix/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
172 changed files
with
3,224 additions
and
1,201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
" Author: gagbo <[email protected]> | ||
" : luibo <[email protected]> | ||
" : Jorengarenar <[email protected]> | ||
" Description: clang-check linter for C files | ||
" modified from cpp/clangcheck.vim to match for C | ||
|
||
call ale#Set('c_clangcheck_executable', 'clang-check') | ||
call ale#Set('c_clangcheck_options', '') | ||
call ale#Set('c_build_dir', '') | ||
|
||
function! ale_linters#c#clangcheck#GetCommand(buffer) abort | ||
let l:user_options = ale#Var(a:buffer, 'c_clangcheck_options') | ||
|
||
" Try to find compilation database to link automatically | ||
let l:build_dir = ale#Var(a:buffer, 'c_build_dir') | ||
|
||
if empty(l:build_dir) | ||
let [l:root, l:json_file] = ale#c#FindCompileCommands(a:buffer) | ||
let l:build_dir = ale#path#Dirname(l:json_file) | ||
endif | ||
|
||
" The extra arguments in the command are used to prevent .plist files from | ||
" being generated. These are only added if no build directory can be | ||
" detected. | ||
return '%e -analyze %s' | ||
\ . (empty(l:build_dir) ? ' --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics': '') | ||
\ . ale#Pad(l:user_options) | ||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '') | ||
endfunction | ||
|
||
call ale#linter#Define('c', { | ||
\ 'name': 'clangcheck', | ||
\ 'output_stream': 'stderr', | ||
\ 'executable': {b -> ale#Var(b, 'c_clangcheck_executable')}, | ||
\ 'command': function('ale_linters#c#clangcheck#GetCommand'), | ||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat', | ||
\ 'lint_file': 1, | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
" Author: 0xhyoga <[email protected]>, | ||
" Description: scarb for cairo files | ||
|
||
function! ale_linters#cairo#scarb#GetScarbExecutable(bufnr) abort | ||
if ale#path#FindNearestFile(a:bufnr, 'Scarb.toml') isnot# '' | ||
return 'scarb' | ||
else | ||
" if there is no Scarb.toml file, we don't use scarb even if it exists, | ||
" so we return '', because executable('') apparently always fails | ||
return '' | ||
endif | ||
endfunction | ||
|
||
function! ale_linters#cairo#scarb#GetCommand(buffer, version) abort | ||
return 'scarb build' | ||
endfunction | ||
|
||
call ale#linter#Define('cairo', { | ||
\ 'name': 'scarb', | ||
\ 'executable': function('ale_linters#cairo#scarb#GetScarbExecutable'), | ||
\ 'command': {buffer -> ale#semver#RunWithVersionCheck( | ||
\ buffer, | ||
\ ale_linters#cairo#scarb#GetScarbExecutable(buffer), | ||
\ '%e --version', | ||
\ function('ale_linters#cairo#scarb#GetCommand'), | ||
\ )}, | ||
\ 'callback': 'ale#handlers#cairo#HandleCairoErrors', | ||
\ 'output_stream': 'both', | ||
\ 'lint_file': 1, | ||
\}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
" Author: Taylor Blau <[email protected]> | ||
call ale#Set('dafny_dafny_timelimit', 10) | ||
|
||
function! ale_linters#dafny#dafny#Handle(buffer, lines) abort | ||
let l:pattern = '\v(.*)\((\d+),(\d+)\): (.*): (.*)' | ||
|
@@ -31,7 +32,6 @@ function! ale_linters#dafny#dafny#GetCommand(buffer) abort | |
return printf('dafny %%s /compile:0 /timeLimit:%d', ale#Var(a:buffer, 'dafny_dafny_timelimit')) | ||
endfunction | ||
|
||
call ale#Set('dafny_dafny_timelimit', 10) | ||
call ale#linter#Define('dafny', { | ||
\ 'name': 'dafny', | ||
\ 'executable': 'dafny', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
" Author: Axel Clark <[email protected]> | ||
" Description: Lexical integration (https://github.com/lexical-lsp/lexical) | ||
|
||
call ale#Set('elixir_lexical_release', 'lexical') | ||
|
||
function! ale_linters#elixir#lexical#GetExecutable(buffer) abort | ||
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_lexical_release')) | ||
let l:cmd = has('win32') ? '\start_lexical.bat' : '/start_lexical.sh' | ||
|
||
return l:dir . l:cmd | ||
endfunction | ||
|
||
call ale#linter#Define('elixir', { | ||
\ 'name': 'lexical', | ||
\ 'lsp': 'stdio', | ||
\ 'executable': function('ale_linters#elixir#lexical#GetExecutable'), | ||
\ 'command': function('ale_linters#elixir#lexical#GetExecutable'), | ||
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'), | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
" Author: neersighted <[email protected]> | ||
" Author: neersighted <[email protected]>, John Eikenberry <[email protected]> | ||
" Description: go vet for Go files | ||
" | ||
" Author: John Eikenberry <[email protected]> | ||
" Description: updated to work with go1.10 | ||
|
||
call ale#Set('go_go_executable', 'go') | ||
call ale#Set('go_govet_options', '') | ||
|
||
function! ale_linters#go#govet#GetCommand(buffer) abort | ||
let l:options = ale#Var(a:buffer, 'go_govet_options') | ||
|
||
return ale#go#EnvString(a:buffer) | ||
\ . ale#Var(a:buffer, 'go_go_executable') . ' vet ' | ||
\ . (!empty(l:options) ? ' ' . l:options : '') | ||
\ . ' .' | ||
endfunction | ||
|
||
call ale#linter#Define('go', { | ||
\ 'name': 'govet', | ||
\ 'aliases': ['go vet'], | ||
\ 'output_stream': 'stderr', | ||
\ 'executable': {b -> ale#Var(b, 'go_go_executable')}, | ||
\ 'cwd': '%s:h', | ||
\ 'command': function('ale_linters#go#govet#GetCommand'), | ||
\ 'command': {b -> | ||
\ ale#go#EnvString(b) | ||
\ . '%e vet' | ||
\ . ale#Pad(ale#Var(b, 'go_govet_options')) | ||
\ . ' .' | ||
\ }, | ||
\ 'callback': 'ale#handlers#go#Handler', | ||
\ 'lint_file': 1, | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,7 @@ function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) a | |
return '%e --format=json --filename %s' | ||
endif | ||
|
||
if ale#semver#GTE(a:version, [1, 6, 0]) | ||
" Reading from stdin was introduced in [email protected] | ||
return '%e --json --filename %s' | ||
endif | ||
|
||
return '%e --json %t' | ||
return '%e --json --filename %s' | ||
endfunction | ||
|
||
function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
" Author: Dalius Dobravolskas <[email protected]> | ||
" Description: VSCode json language server | ||
|
||
call ale#Set('json_vscodejson_executable', '<auto>') | ||
|
||
function! ale_linters#json#vscodejson#GetExecutable(buffer) abort | ||
let l:executable = ale#Var(a:buffer, 'json_vscodejson_executable') | ||
|
||
if l:executable is# '<auto>' | ||
if ale#engine#IsExecutable(a:buffer, 'vscode-json-languageserver') | ||
let l:executable = 'vscode-json-languageserver' | ||
else | ||
let l:executable = 'vscode-json-language-server' | ||
endif | ||
endif | ||
|
||
return l:executable | ||
endfunction | ||
|
||
function! ale_linters#json#vscodejson#GetProjectRoot(buffer) abort | ||
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git') | ||
|
||
|
@@ -10,7 +26,7 @@ endfunction | |
call ale#linter#Define('json', { | ||
\ 'name': 'vscodejson', | ||
\ 'lsp': 'stdio', | ||
\ 'executable': 'vscode-json-language-server', | ||
\ 'executable': function('ale_linters#json#vscodejson#GetExecutable'), | ||
\ 'command': '%e --stdio', | ||
\ 'project_root': function('ale_linters#json#vscodejson#GetProjectRoot'), | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.