summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2017-03-28 23:28:13 +0100
committerGitHub <noreply@github.com>2017-03-28 23:28:13 +0100
commit81b49b2dffc7c533ad155d1c266d2a9c68e20c15 (patch)
treea670b9f155f7e23a11c7b782cfafc74bb8ae462e
parentd7f8324c3c9b9eb6ea49591fc4fa37948996170d (diff)
parent6a5d8ba5d02a3d0cc051a94e7ca327755b1fdc37 (diff)
downloadale-81b49b2dffc7c533ad155d1c266d2a9c68e20c15.zip
Merge pull request #424 from adriaanzon/command-enable-disable
Add :ALEEnable and :ALEDisable commands
-rw-r--r--doc/ale.txt2
-rw-r--r--plugin/ale.vim5
2 files changed, 6 insertions, 1 deletions
diff --git a/doc/ale.txt b/doc/ale.txt
index 6f64abe0..e6b312cb 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -594,6 +594,8 @@ ALENextWrap *ALENextWrap*
<
ALEToggle *ALEToggle*
+ALEEnable *ALEEnable*
+ALEDisable *ALEDisable*
Enable or disable ALE, including all of its autocmd events, loclist items,
quickfix items, signs, current jobs, etc. Calling this option will change
diff --git a/plugin/ale.vim b/plugin/ale.vim
index 42c6f28c..d728854c 100644
--- a/plugin/ale.vim
+++ b/plugin/ale.vim
@@ -233,8 +233,11 @@ command! -bar ALENextWrap :call ale#loclist_jumping#Jump('after', 1)
" A command for showing error details.
command! -bar ALEDetail :call ale#cursor#ShowCursorDetail()
-" A command for turning ALE on or off.
+" Define commands for turning ALE on or off.
command! -bar ALEToggle :call s:ALEToggle()
+command! -bar ALEEnable :if !g:ale_enabled | ALEToggle | endif
+command! -bar ALEDisable :if g:ale_enabled | ALEToggle | endif
+
" A command for linting manually.
command! -bar ALELint :call ale#Queue(0, 'lint_file')