Enabling linting on save by default, re #333
This commit is contained in:
parent
4abefc189c
commit
c9ee3efc11
5 changed files with 14 additions and 12 deletions
19
README.md
19
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?
|
### 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
|
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
|
when files are saved. This option is enabled by default. If you only
|
||||||
as you are editing files, then you can turn the option for linting
|
wish to run linters when files are saved, you can turn the other
|
||||||
when text is changed off too.
|
options off.
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
" Write this in your vimrc file
|
" Write this in your vimrc file
|
||||||
let g:ale_lint_on_save = 1
|
|
||||||
let g:ale_lint_on_text_changed = 0
|
let g:ale_lint_on_text_changed = 0
|
||||||
" You can disable this option too
|
" You can disable this option too
|
||||||
" if you don't want linters to run on opening a file
|
" if you don't want linters to run on opening a file
|
||||||
let g:ale_lint_on_enter = 0
|
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`.
|
||||||
|
|
||||||
<a name="faq-quickfix"></a>
|
<a name="faq-quickfix"></a>
|
||||||
|
|
||||||
### 5.ix. How can I use the quickfix list instead of the loclist?
|
### 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.
|
`:help g:ale_lint_delay` for more information.
|
||||||
|
|
||||||
If you don't wish to run linters while you type, you can disable that
|
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
|
behaviour. Set `g:ale_lint_on_text_changed` to `0`. You won't get as frequent
|
||||||
`g:ale_lint_on_save` to `1` to enable linting when you save files. You won't
|
error checking, but ALE shouldn't block your ability to edit a document after
|
||||||
get as frequent error checking, but ALE shouldn't block your ability to edit a
|
you save a file, so the asynchronous nature of the plugin will still be an
|
||||||
document after you save a file, so the asynchronous nature of the plugin will
|
advantage.
|
||||||
still be an advantage.
|
|
||||||
|
|
||||||
If you are still concerned, you can turn the automatic linting off altogether,
|
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
|
including the option `g:ale_lint_on_enter`, and you can run ALE manually with
|
||||||
|
|
|
@ -279,7 +279,7 @@ g:ale_lint_on_enter *g:ale_lint_on_enter*
|
||||||
g:ale_lint_on_save *g:ale_lint_on_save*
|
g:ale_lint_on_save *g:ale_lint_on_save*
|
||||||
|
|
||||||
Type: |Number|
|
Type: |Number|
|
||||||
Default: `0`
|
Default: `1`
|
||||||
|
|
||||||
This option will make ALE run the linters whenever a file is saved when it
|
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
|
it set to `1` in your vimrc file. This option can be used in combination
|
||||||
|
|
|
@ -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)
|
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.
|
" 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
|
" This flag may be set to 0 to disable ale. After ale is loaded, :ALEToggle
|
||||||
" should be used instead.
|
" should be used instead.
|
||||||
|
|
|
@ -18,7 +18,7 @@ Before:
|
||||||
\ 'let g:ale_keep_list_window_open = 0',
|
\ 'let g:ale_keep_list_window_open = 0',
|
||||||
\ 'let g:ale_lint_delay = 200',
|
\ 'let g:ale_lint_delay = 200',
|
||||||
\ 'let g:ale_lint_on_enter = 1',
|
\ '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_lint_on_text_changed = 1',
|
||||||
\ 'let g:ale_linter_aliases = {}',
|
\ 'let g:ale_linter_aliases = {}',
|
||||||
\ 'let g:ale_linters = {}',
|
\ 'let g:ale_linters = {}',
|
||||||
|
|
|
@ -15,6 +15,7 @@ Before:
|
||||||
\ 'ALECursorGroup',
|
\ 'ALECursorGroup',
|
||||||
\ 'ALEHighlightBufferGroup',
|
\ 'ALEHighlightBufferGroup',
|
||||||
\ 'ALERunOnEnterGroup',
|
\ 'ALERunOnEnterGroup',
|
||||||
|
\ 'ALERunOnSaveGroup',
|
||||||
\ 'ALERunOnTextChangedGroup',
|
\ 'ALERunOnTextChangedGroup',
|
||||||
\]
|
\]
|
||||||
|
|
||||||
|
|
Reference in a new issue