diff --git a/plugin/ale/aaflags.vim b/plugin/ale/aaflags.vim index 467e3b6..75accc9 100644 --- a/plugin/ale/aaflags.vim +++ b/plugin/ale/aaflags.vim @@ -20,6 +20,9 @@ let g:ale_lint_delay = get(g:, 'ale_lint_delay', 100) " This flag can be set to 0 to disable linting when the buffer is entered. let g:ale_lint_on_enter = get(g:, 'ale_lint_on_enter', 1) +" This flag can be set to 1 to enable linting when a buffer is written. +let g:ale_lint_on_save = get(g:, 'ale_lint_on_save', 0) + " This flag can be set to 0 to disable setting the loclist. let g:ale_set_loclist = get(g:, 'ale_set_loclist', 1) diff --git a/plugin/ale/zmain.vim b/plugin/ale/zmain.vim index d73bcbe..00a6648 100644 --- a/plugin/ale/zmain.vim +++ b/plugin/ale/zmain.vim @@ -354,6 +354,13 @@ if g:ale_lint_on_enter augroup END endif +if g:ale_lint_on_save + augroup ALERunOnSaveGroup + autocmd! + autocmd BufWrite * call ALELint(0) + augroup END +endif + " Clean up buffers automatically when they are unloaded. augroup ALEBuffferCleanup autocmd!