From a95aa97780ad4df7b57c6a95cb904a434841a6bc Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 4 Oct 2016 21:31:47 +0100 Subject: [PATCH] Add support for linting when a file is saved. --- plugin/ale/aaflags.vim | 3 +++ plugin/ale/zmain.vim | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/plugin/ale/aaflags.vim b/plugin/ale/aaflags.vim index 467e3b6a..75accc9e 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 d73bcbee..00a6648a 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!