summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-29 10:55:02 +0000
committerw0rp <devw0rp@gmail.com>2017-10-29 10:55:02 +0000
commit1aa737cdc9b6e92b51823df93f356b4ec37beab3 (patch)
tree6e5dd0751c3eeb2207c8373d1f2fa05cf97eab1b
parent5fc2b98b73b74a0d57037683f0c809eac41368f0 (diff)
downloadale-1aa737cdc9b6e92b51823df93f356b4ec37beab3.zip
#817 - Document the buffer toggling options, and define plug mappings for everything
-rw-r--r--doc/ale.txt37
-rw-r--r--plugin/ale.vim5
2 files changed, 35 insertions, 7 deletions
diff --git a/doc/ale.txt b/doc/ale.txt
index c90ab1d7..20269788 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -1447,13 +1447,36 @@ ALELast *ALELast*
ALEToggle *ALEToggle*
ALEEnable *ALEEnable*
ALEDisable *ALEDisable*
-
- 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.
-
- For convenience, a plug mapping `<Plug>(ale_toggle)` is defined for the
- |ALEToggle| command.
+ALEToggleBuffer *ALEToggleBuffer*
+ALEEnableBuffer *ALEEnableBuffer*
+ALEDisableBuffer *ALEDisableBuffer*
+
+ `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.
+
+ 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| - `<Plug>(ale_toggle)`
+ |ALEEnable| - `<Plug>(ale_enable)`
+ |ALEDisable| - `<Plug>(ale_disable)`
+ |ALEToggleBuffer| - `<Plug>(ale_toggle_buffer)`
+ |ALEEnableBuffer| - `<Plug>(ale_enable_buffer)`
+ |ALEDisableBuffer| - `<Plug>(ale_disable_buffer)`
ALEDetail *ALEDetail*
diff --git a/plugin/ale.vim b/plugin/ale.vim
index 3e1803e5..f700affc 100644
--- a/plugin/ale.vim
+++ b/plugin/ale.vim
@@ -250,6 +250,11 @@ nnoremap <silent> <Plug>(ale_next_wrap) :ALENextWrap<Return>
nnoremap <silent> <Plug>(ale_first) :ALEFirst<Return>
nnoremap <silent> <Plug>(ale_last) :ALELast<Return>
nnoremap <silent> <Plug>(ale_toggle) :ALEToggle<Return>
+nnoremap <silent> <Plug>(ale_enable) :ALEEnable<Return>
+nnoremap <silent> <Plug>(ale_disable) :ALEDisable<Return>
+nnoremap <silent> <Plug>(ale_toggle_buffer) :ALEToggleBuffer<Return>
+nnoremap <silent> <Plug>(ale_enable_buffer) :ALEEnableBuffer<Return>
+nnoremap <silent> <Plug>(ale_disable_buffer) :ALEDisableBuffer<Return>
nnoremap <silent> <Plug>(ale_lint) :ALELint<Return>
nnoremap <silent> <Plug>(ale_detail) :ALEDetail<Return>
nnoremap <silent> <Plug>(ale_fix) :ALEFix<Return>