From ALE's README.md
ALE can fix files with the ALEFix command. Functions need to be configured either in each buffer with a b:ale_fixers, or globally with g:ale_fixers.
The recommended way to configure fixers is to define a List in an ftplugin file.
The proper way of configuring isort
is by setting g:ale_fixers
in your vimrc
/ init.vim
or b:ale_fixers
in ftplugin/python.vim
.
E.g.
" setting it globally
let g:ale_fixers = {
\ 'python': ['black', 'isort'],
\ }
Any command line options you want to pass to isort you do it by setting g:ale_python_isort_options
.
let g:ale_python_isort_options = '--profile black -l 100'
If you want to automatically fix files when you save them, you need to turn a setting on in vimrc.
" Set this variable to 1 to fix files when you save them.
let g:ale_fix_on_save = 1