mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-20 19:21:18 +08:00
Add support for latexindent (#2387)
This commit is contained in:
@@ -285,6 +285,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['kt'],
|
||||
\ 'description': 'Fix Kotlin files with ktlint.',
|
||||
\ },
|
||||
\ 'latexindent': {
|
||||
\ 'function': 'ale#fixers#latexindent#Fix',
|
||||
\ 'suggested_filetypes': ['tex'],
|
||||
\ 'description' : 'Indent code within environments, commands, after headings and within special code blocks.',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
18
autoload/ale/fixers/latexindent.vim
Normal file
18
autoload/ale/fixers/latexindent.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
" Author: riley-martine <riley.martine@protonmail.com>
|
||||
" Description: Integration of latexindent with ALE.
|
||||
|
||||
call ale#Set('tex_latexindent_executable', 'latexindent')
|
||||
call ale#Set('tex_latexindent_options', '')
|
||||
|
||||
function! ale#fixers#latexindent#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'tex_latexindent_executable')
|
||||
let l:options = ale#Var(a:buffer, 'tex_latexindent_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -l -w'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user