diff --git a/doc/ale.txt b/doc/ale.txt index c90ab1d..2026978 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -1447,13 +1447,36 @@ ALELast *ALELast* ALEToggle *ALEToggle* ALEEnable *ALEEnable* ALEDisable *ALEDisable* +ALEToggleBuffer *ALEToggleBuffer* +ALEEnableBuffer *ALEEnableBuffer* +ALEDisableBuffer *ALEDisableBuffer* - Enable or disable ALE, including all of its autocmd events, loclist items, - quickfix items, signs, current jobs, etc. Executing any of those commands - will change the |g:ale_enabled| variable. + `ALEToggle`, `ALEEnable`, and `ALEDisable` enable or disable ALE linting, + including all of its autocmd events, loclist items, quickfix items, signs, + current jobs, etc., globally. Executing any of these commands will change + the |g:ale_enabled| variable. - For convenience, a plug mapping `(ale_toggle)` is defined for the - |ALEToggle| command. + ALE can be disabled or enabled for only a single buffer with + `ALEToggleBuffer`, `ALEEnableBuffer`, and `ALEDisableBuffer`. Disabling ALE + for a buffer will not remove autocmd events, but will prevent ALE from + checking for problems and reporting problems for whatever buffer the + `ALEDisableBuffer` or `ALEToggleBuffer` command is executed from. These + commands can be used for temporarily disabling ALE for a buffer. These + commands will modify the |b:ale_enabled| variable. + + ALE linting cannot be enabled for a single buffer when it is disabled + globally, as disabling ALE globally removes the autocmd events needed to + perform linting with. + + The following plug mappings are defined, for conveniently defining + keybinds: + + |ALEToggle| - `(ale_toggle)` + |ALEEnable| - `(ale_enable)` + |ALEDisable| - `(ale_disable)` + |ALEToggleBuffer| - `(ale_toggle_buffer)` + |ALEEnableBuffer| - `(ale_enable_buffer)` + |ALEDisableBuffer| - `(ale_disable_buffer)` ALEDetail *ALEDetail* diff --git a/plugin/ale.vim b/plugin/ale.vim index 3e1803e..f700aff 100644 --- a/plugin/ale.vim +++ b/plugin/ale.vim @@ -250,6 +250,11 @@ nnoremap (ale_next_wrap) :ALENextWrap nnoremap (ale_first) :ALEFirst nnoremap (ale_last) :ALELast nnoremap (ale_toggle) :ALEToggle +nnoremap (ale_enable) :ALEEnable +nnoremap (ale_disable) :ALEDisable +nnoremap (ale_toggle_buffer) :ALEToggleBuffer +nnoremap (ale_enable_buffer) :ALEEnableBuffer +nnoremap (ale_disable_buffer) :ALEDisableBuffer nnoremap (ale_lint) :ALELint nnoremap (ale_detail) :ALEDetail nnoremap (ale_fix) :ALEFix