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

Updated plugins

This commit is contained in:
Amir
2021-07-04 22:47:44 +02:00
parent 597b7acdc0
commit e19ae5588a
28 changed files with 297 additions and 103 deletions

View File

@ -18,20 +18,25 @@ endfunction
function! ale#fixers#black#Fix(buffer) abort
let l:executable = ale#fixers#black#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
\ ? ' run black'
\ : ''
let l:options = ale#Var(a:buffer, 'python_black_options')
let l:cmd = [ale#Escape(l:executable)]
if expand('#' . a:buffer . ':e') is? 'pyi'
let l:options .= '--pyi'
if l:executable =~? 'pipenv$'
call extend(l:cmd, ['run', 'black'])
endif
let l:result = {
\ 'command': ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' -',
\}
let l:options = ale#Var(a:buffer, 'python_black_options')
if !empty(l:options)
call add(l:cmd, l:options)
endif
if expand('#' . a:buffer . ':e') is? 'pyi'
call add(l:cmd, '--pyi')
endif
call add(l:cmd, '-')
let l:result = {'command': join(l:cmd, ' ')}
if ale#Var(a:buffer, 'python_black_change_directory')
let l:result.cwd = '%s:h'

View File

@ -0,0 +1,16 @@
scriptencoding utf-8
" Author: Jesse Hathaway <jesse@mbuki-mvuki.org>
" Description: Fix markdown files with pandoc.
call ale#Set('markdown_pandoc_executable', 'pandoc')
call ale#Set('markdown_pandoc_options', '-f gfm -t gfm -s -')
function! ale#fixers#pandoc#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'markdown_pandoc_executable')
let l:options = ale#Var(a:buffer, 'markdown_pandoc_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' ' . l:options,
\}
endfunction

View File

@ -0,0 +1,14 @@
" Author: Robert Liebowitz <rliebz@gmail.com>
" Description: https://github.com/johnnymorganz/stylua
call ale#Set('lua_stylua_executable', 'stylua')
call ale#Set('lua_stylua_options', '')
function! ale#fixers#stylua#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'lua_stylua_executable')
let l:options = ale#Var(a:buffer, 'lua_stylua_options')
return {
\ 'command': ale#Escape(l:executable) . ale#Pad(l:options) . ' -',
\}
endfunction