Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Separate fixers on save from enabled fixers. #1930

@davidtwco

Description

@davidtwco

I'd like to be able to have a set of fixers that run on save that is separate from the fixers that run with :ALEFix.

For example, I universally want to have the remove_trailing_lines and trim_whitespace fixers to run when I save a file, but I do not always want to run the rustfmt fixer when I save (some projects don't use it and I don't want to reformat lots of code that isn't my own).

" `ale_fixers` is a superset of `ale_fixers_on_save` and contains those listed in `ale_fixers_on_save`.
let g:ale_fixers = {
\   'rust': [ 'rustfmt' ],
\ }
let g:ale_fixers_on_save = {
\   '*': [ 'remove_trailing_lines', 'trim_whitespace' ],
\ }

This would enable me to always have trailing lines removed and whitespace trimmed without needing to remember to do that, but gives me the option of triggering rustfmt manually through ALE on my own projects with my binding to :ALEFix.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions