diff --git a/README.md b/README.md index 8a66eec..e9eaf3b 100644 --- a/README.md +++ b/README.md @@ -362,19 +362,21 @@ For more information, consult the online documentation with ### 5.viii. How can I run linters only when I save files? ALE offers an option `g:ale_lint_on_save` for enabling running the linters -when files are saved. If you wish to run linters when files are saved, not -as you are editing files, then you can turn the option for linting -when text is changed off too. +when files are saved. This option is enabled by default. If you only +wish to run linters when files are saved, you can turn the other +options off. ```vim " Write this in your vimrc file -let g:ale_lint_on_save = 1 let g:ale_lint_on_text_changed = 0 " You can disable this option too " if you don't want linters to run on opening a file let g:ale_lint_on_enter = 0 ``` +If for whatever reason you don't wish to run linters again when you save +files, you can set `g:ale_lint_on_save` to `0`. + ### 5.ix. How can I use the quickfix list instead of the loclist? @@ -451,11 +453,10 @@ type, and this delay can be increased so linters are run less often. See `:help g:ale_lint_delay` for more information. If you don't wish to run linters while you type, you can disable that -behaviour. Set `g:ale_lint_on_text_changed` to `0`, and consider setting -`g:ale_lint_on_save` to `1` to enable linting when you save files. You won't -get as frequent error checking, but ALE shouldn't block your ability to edit a -document after you save a file, so the asynchronous nature of the plugin will -still be an advantage. +behaviour. Set `g:ale_lint_on_text_changed` to `0`. You won't get as frequent +error checking, but ALE shouldn't block your ability to edit a document after +you save a file, so the asynchronous nature of the plugin will still be an +advantage. If you are still concerned, you can turn the automatic linting off altogether, including the option `g:ale_lint_on_enter`, and you can run ALE manually with diff --git a/doc/ale.txt b/doc/ale.txt index b09a054..932b520 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -279,7 +279,7 @@ g:ale_lint_on_enter *g:ale_lint_on_enter* g:ale_lint_on_save *g:ale_lint_on_save* Type: |Number| - Default: `0` + Default: `1` This option will make ALE run the linters whenever a file is saved when it it set to `1` in your vimrc file. This option can be used in combination diff --git a/plugin/ale.vim b/plugin/ale.vim index 3033fd5..2e59389 100644 --- a/plugin/ale.vim +++ b/plugin/ale.vim @@ -76,7 +76,7 @@ let g:ale_lint_on_text_changed = get(g:, 'ale_lint_on_text_changed', 1) 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) +let g:ale_lint_on_save = get(g:, 'ale_lint_on_save', 1) " This flag may be set to 0 to disable ale. After ale is loaded, :ALEToggle " should be used instead. diff --git a/test/test_ale_info.vader b/test/test_ale_info.vader index ecea899..6dd6afe 100644 --- a/test/test_ale_info.vader +++ b/test/test_ale_info.vader @@ -18,7 +18,7 @@ Before: \ 'let g:ale_keep_list_window_open = 0', \ 'let g:ale_lint_delay = 200', \ 'let g:ale_lint_on_enter = 1', - \ 'let g:ale_lint_on_save = 0', + \ 'let g:ale_lint_on_save = 1', \ 'let g:ale_lint_on_text_changed = 1', \ 'let g:ale_linter_aliases = {}', \ 'let g:ale_linters = {}', diff --git a/test/test_ale_toggle.vader b/test/test_ale_toggle.vader index 2cd0110..e623a08 100644 --- a/test/test_ale_toggle.vader +++ b/test/test_ale_toggle.vader @@ -15,6 +15,7 @@ Before: \ 'ALECursorGroup', \ 'ALEHighlightBufferGroup', \ 'ALERunOnEnterGroup', + \ 'ALERunOnSaveGroup', \ 'ALERunOnTextChangedGroup', \]