mirror of
https://github.com/amix/vimrc
synced 2025-08-07 22:35:01 +08:00
Updated plugins
This commit is contained in:
18
sources_non_forked/ale/autoload/ale/fixers/dfmt.vim
Normal file
18
sources_non_forked/ale/autoload/ale/fixers/dfmt.vim
Normal file
@ -0,0 +1,18 @@
|
||||
" Author: theoldmoon0602
|
||||
" Description: Integration of dfmt with ALE.
|
||||
|
||||
call ale#Set('d_dfmt_executable', 'dfmt')
|
||||
call ale#Set('d_dfmt_options', '')
|
||||
|
||||
function! ale#fixers#dfmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'd_dfmt_executable')
|
||||
let l:options = ale#Var(a:buffer, 'd_dfmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -i'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
21
sources_non_forked/ale/autoload/ale/fixers/html_beautify.vim
Normal file
21
sources_non_forked/ale/autoload/ale/fixers/html_beautify.vim
Normal file
@ -0,0 +1,21 @@
|
||||
" Author: WhyNotHugo <hugo@barrera.io>
|
||||
" Description: Lint HTML files with html-beautify.
|
||||
"
|
||||
call ale#Set('html_beautify_executable', 'html-beautify')
|
||||
call ale#Set('html_beautify_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('html_beautify_options', '')
|
||||
call ale#Set('html_beautify_change_directory', 1)
|
||||
|
||||
function! ale#fixers#html_beautify#Fix(buffer) abort
|
||||
let l:executable = ale#python#FindExecutable(
|
||||
\ a:buffer,
|
||||
\ 'html_beautify',
|
||||
\ ['html-beautify']
|
||||
\)
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'html_beautify_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable). ' ' . l:options . ' -',
|
||||
\}
|
||||
endfunction
|
15
sources_non_forked/ale/autoload/ale/fixers/nimpretty.vim
Normal file
15
sources_non_forked/ale/autoload/ale/fixers/nimpretty.vim
Normal file
@ -0,0 +1,15 @@
|
||||
" Author: Nhan <hi@imnhan.com>
|
||||
" Description: Integration of nimpretty with ALE.
|
||||
|
||||
call ale#Set('nim_nimpretty_executable', 'nimpretty')
|
||||
call ale#Set('nim_nimpretty_options', '--maxLineLen:80')
|
||||
|
||||
function! ale#fixers#nimpretty#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'nim_nimpretty_executable')
|
||||
let l:options = ale#Var(a:buffer, 'nim_nimpretty_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' %t' . ale#Pad(l:options),
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
12
sources_non_forked/ale/autoload/ale/fixers/nixpkgsfmt.vim
Normal file
12
sources_non_forked/ale/autoload/ale/fixers/nixpkgsfmt.vim
Normal file
@ -0,0 +1,12 @@
|
||||
call ale#Set('nix_nixpkgsfmt_executable', 'nixpkgs-fmt')
|
||||
call ale#Set('nix_nixpkgsfmt_options', '')
|
||||
|
||||
function! ale#fixers#nixpkgsfmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'nix_nixpkgsfmt_executable')
|
||||
let l:options = ale#Var(a:buffer, 'nix_nixpkgsfmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
22
sources_non_forked/ale/autoload/ale/fixers/purty.vim
Normal file
22
sources_non_forked/ale/autoload/ale/fixers/purty.vim
Normal file
@ -0,0 +1,22 @@
|
||||
" Author: iclanzan <sorin@iclanzan.com>
|
||||
" Description: Integration of purty with ALE.
|
||||
|
||||
call ale#Set('purescript_purty_executable', 'purty')
|
||||
|
||||
function! ale#fixers#purty#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'purescript_purty_executable')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#purty#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#purty#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ . ' --write'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
@ -6,7 +6,7 @@ function! ale#fixers#rubocop#GetCommand(buffer) abort
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, '.rubocop.yml')
|
||||
let l:options = ale#Var(a:buffer, 'ruby_rubocop_options')
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'rubocop')
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'rubocop')
|
||||
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --auto-correct --force-exclusion %t'
|
||||
|
@ -5,7 +5,7 @@ function! ale#fixers#sorbet#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
|
||||
let l:options = ale#Var(a:buffer, 'ruby_sorbet_options')
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'srb')
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'srb')
|
||||
\ . ' tc'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --autocorrect --file %t'
|
||||
|
16
sources_non_forked/ale/autoload/ale/fixers/sqlformat.vim
Normal file
16
sources_non_forked/ale/autoload/ale/fixers/sqlformat.vim
Normal file
@ -0,0 +1,16 @@
|
||||
" Author: Cluas <Cluas@live.cn>
|
||||
" Description: Fixing files with sqlformat.
|
||||
|
||||
call ale#Set('sql_sqlformat_executable', 'sqlformat')
|
||||
call ale#Set('sql_sqlformat_options', '')
|
||||
|
||||
function! ale#fixers#sqlformat#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'sql_sqlformat_executable')
|
||||
let l:options = ale#Var(a:buffer, 'sql_sqlformat_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' -'
|
||||
\}
|
||||
endfunction
|
@ -7,6 +7,7 @@ call ale#Set('javascript_standard_options', '')
|
||||
|
||||
function! ale#fixers#standard#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_standard', [
|
||||
\ 'node_modules/standardx/bin/cmd.js',
|
||||
\ 'node_modules/standard/bin/cmd.js',
|
||||
\ 'node_modules/.bin/standard',
|
||||
\])
|
||||
@ -14,7 +15,14 @@ endfunction
|
||||
|
||||
function! ale#fixers#standard#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#standard#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'javascript_standard_options')
|
||||
let l:filetype = getbufvar(a:buffer, '&filetype')
|
||||
let l:options_type = 'javascript_standard_options'
|
||||
|
||||
if l:filetype =~# 'typescript'
|
||||
let l:options_type = 'typescript_standard_options'
|
||||
endif
|
||||
|
||||
let l:options = ale#Var(a:buffer, l:options_type)
|
||||
|
||||
return {
|
||||
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||
|
@ -9,7 +9,7 @@ function! ale#fixers#standardrb#GetCommand(buffer) abort
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, '.standard.yml')
|
||||
let l:options = ale#Var(a:buffer, 'ruby_standardrb_options')
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'standardrb')
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'standardrb')
|
||||
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --fix --force-exclusion %t'
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
call ale#Set('stylelint_executable', 'stylelint')
|
||||
call ale#Set('stylelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('stylelint_options', '')
|
||||
|
||||
function! ale#fixers#stylelint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'stylelint', [
|
||||
@ -13,10 +14,14 @@ endfunction
|
||||
|
||||
function! ale#fixers#stylelint#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#stylelint#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'stylelint_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ' --fix %t',
|
||||
\ 'command': ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ' %t'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . ' --fix',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
@ -2,13 +2,13 @@
|
||||
" Description: Fixing R files with styler.
|
||||
|
||||
call ale#Set('r_styler_executable', 'Rscript')
|
||||
call ale#Set('r_styler_options', 'tidyverse_style')
|
||||
call ale#Set('r_styler_options', 'tidyverse_style()')
|
||||
|
||||
function! ale#fixers#styler#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': 'Rscript --vanilla -e '
|
||||
\ . '"suppressPackageStartupMessages(library(styler));'
|
||||
\ . 'style_file(commandArgs(TRUE), style = '
|
||||
\ . 'style_file(commandArgs(TRUE), transformers = '
|
||||
\ . ale#Var(a:buffer, 'r_styler_options') . ')"'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
|
Reference in New Issue
Block a user