Support for tex-fmt (#5127)
CI / Build (push) Waiting to run
CI / Lint (push) Blocked by required conditions
CI / Lua (push) Blocked by required conditions
CI / Neovim 0.10 Linux (push) Blocked by required conditions
CI / Neovim 0.12 Linux (push) Blocked by required conditions
CI / Vim 8.2 Linux (push) Blocked by required conditions
CI / Vim 9.2 Linux (push) Blocked by required conditions
CI / Neovim 0.10 Windows (push) Waiting to run
CI / Neovim 0.12 Windows (push) Waiting to run
CI / Vim 8.2 Windows (push) Waiting to run
CI / Vim 9.2 Windows (push) Waiting to run

* Support for tex-fmt

Support for tex-fmt, https://github.com/WGUNDERWOOD/tex-fmt.

* Remove file type plaintex

Remove file type plaintex as tex-fmt is solely for LaTeX.
See
https://superuser.com/questions/208177/vim-and-tex-filetypes-plaintex-vs-tex
for a distinction.
This commit is contained in:
Matheus Gabriel Werny
2026-05-15 00:00:05 +02:00
committed by GitHub
parent 641294465e
commit 916c8764ce
7 changed files with 64 additions and 0 deletions
+5
View File
@@ -777,6 +777,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['markdown'],
\ 'description': 'Fix markdown files with rumdl.',
\ },
\ 'tex-fmt': {
\ 'function': 'ale#fixers#tex_fmt#Fix',
\ 'suggested_filetypes': ['bib', 'tex'],
\ 'description': 'Fix LaTeX and bibliography files with tex-fmt.',
\ }
\}
" Reset the function registry to the default entries.
+20
View File
@@ -0,0 +1,20 @@
" Author: https://github.com/Spixmaster
" Description: Fix LaTeX and bibliography files with tex-fmt.
call ale#Set('tex_tex_fmt_executable', 'tex-fmt')
call ale#Set('tex_tex_fmt_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('tex_tex_fmt_options', '')
function! ale#fixers#tex_fmt#Fix(buffer) abort
let l:executable = ale#python#FindExecutable(
\ a:buffer,
\ 'tex_tex_fmt',
\ ['tex-fmt']
\)
let l:options = ale#Var(a:buffer, 'tex_tex_fmt_options')
return {
\ 'command': ale#Escape(l:executable) . ' ' . l:options . ' -s',
\}
endfunction
@@ -373,6 +373,7 @@ Notes:
* `lacheck`
* `proselint`
* `redpen`
* `tex-fmt`
* `texlab`
* `textlint`
* `vale`
+24
View File
@@ -70,6 +70,30 @@ g:ale_tex_latexindent_options
This variable can be changed to modify flags given to latexindent.
===============================================================================
tex-fmt *ale-tex-tex-fmt*
*ale-options.tex_tex_fmt_executable*
*g:ale_tex_tex_fmt_executable*
*b:ale_tex_tex_fmt_executable*
tex_tex_fmt_executable
g:ale_tex_tex_fmt_executable
Type: |String|
Default: `'tex-fmt'`
See |ale-integrations-local-executables|.
*ale-options.tex_tex_fmt_options*
*g:ale_tex_tex_fmt_options*
*b:ale_tex_tex_fmt_options*
tex_tex_fmt_options
g:ale_tex_tex_fmt_options
Type: |String|
Default: `''`
This variable can be changed to modify flags given to tex-fmt.
===============================================================================
texlab *ale-tex-texlab*
+1
View File
@@ -4008,6 +4008,7 @@ documented in additional help files.
cspell................................|ale-tex-cspell|
lacheck...............................|ale-tex-lacheck|
latexindent...........................|ale-tex-latexindent|
tex-fmt...............................|ale-tex-tex-fmt|
texlab................................|ale-tex-texlab|
redpen................................|ale-tex-redpen|
texinfo.................................|ale-texinfo-options|
+1
View File
@@ -383,6 +383,7 @@ formatting.
* [lacheck](https://www.ctan.org/pkg/lacheck)
* [proselint](http://proselint.com/)
* [redpen](http://redpen.cc/)
* [tex-fmt](https://github.com/WGUNDERWOOD/tex-fmt)
* [texlab](https://texlab.netlify.com) :speech_balloon:
* [textlint](https://textlint.github.io/)
* [vale](https://github.com/ValeLint/vale)
@@ -0,0 +1,12 @@
Before:
call ale#assert#SetUpFixerTest('tex', 'tex-fmt')
After:
Restore
call ale#assert#TearDownFixerTest()
Execute(The tex-fmt callback should return the correct default command):
AssertEqual
\ {'command': ale#Escape('tex-fmt') . ' -s'},
\ ale#fixers#tex_fmt#Fix(bufnr(''))