From 88817b3780109c3935200546459d3d35806a90a0 Mon Sep 17 00:00:00 2001 From: Horacio Sanson Date: Sat, 19 Jun 2021 19:47:35 +0900 Subject: [PATCH] Fix 3167 - add custom fixer example to help docs. (#3541) Co-authored-by: Horacio Sanson --- doc/ale.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/ale.txt b/doc/ale.txt index 62881503..a126f360 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -3734,6 +3734,21 @@ ale#fix#registry#Add(name, func, filetypes, desc, [aliases]) ALE will search for fixers in the registry first by `name`, then by their `aliases`. + For example to register a custom fixer for `luafmt`: > + + function! FormatLua(buffer) abort + return { + \ 'command': 'luafmt --stdin' + \} + endfunction + + execute ale#fix#registry#Add('luafmt', 'FormatLua', ['lua'], 'luafmt for lua') + + " You can now use it in g:ale_fixers + let g:ale_fixers = { + \ 'lua': ['luafmt'] + } +< ale#linter#Define(filetype, linter) *ale#linter#Define()*