From b10ac4ad4a82d19b73418d3e907fd8657b633db1 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 25 Oct 2017 10:27:25 +0800 Subject: [PATCH] Update doc --- autoload/SpaceVim/layers/checkers.vim | 11 +++++++++-- config/plugins/ale.vim | 1 + docs/layers/checkers.md | 26 +++++++++++++++++++++----- 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 config/plugins/ale.vim diff --git a/autoload/SpaceVim/layers/checkers.vim b/autoload/SpaceVim/layers/checkers.vim index ab08e620a..d5229dad9 100644 --- a/autoload/SpaceVim/layers/checkers.vim +++ b/autoload/SpaceVim/layers/checkers.vim @@ -34,7 +34,14 @@ function! SpaceVim#layers#checkers#config() abort endfunction function! s:error_transient_state() abort - if empty(neomake#statusline#LoclistCounts()) + if g:spacevim_enable_neomake + let has_errors = neomake#statusline#LoclistCounts() + elseif g:spacevim_enable_ale + let has_errors = '' + else + let has_errors = '' + endif + if empty(has_errors) echo 'no buffers contain error message locations' return endif @@ -88,7 +95,7 @@ else endfunction endif - +" TODO clear errors function! s:clear_errors() abort sign unplace * endfunction diff --git a/config/plugins/ale.vim b/config/plugins/ale.vim new file mode 100644 index 000000000..a941ecb93 --- /dev/null +++ b/config/plugins/ale.vim @@ -0,0 +1 @@ +scriptencoding utf-8 diff --git a/docs/layers/checkers.md b/docs/layers/checkers.md index d42b8b01e..c55ab8444 100644 --- a/docs/layers/checkers.md +++ b/docs/layers/checkers.md @@ -1,17 +1,32 @@ -# [Layers](https://spacevim.org/layers) > checkers +--- +title: "SpaceVim checkers layer" +--- + +# [SpaceVim Layers:](https://spacevim.org/layers) checkers + + + +- [Description](#description) +- [Layer Installation](#layer-installation) +- [Configuration](#configuration) +- [Key bindings](#key-bindings) + + + +## Description This layer provides syntax checking feature. -## Install +## Layer Installation checkers layer is loaded by default. -## options +## Configuration | Name | default value | description | | ---------------------------- | ------------- | -------------------------------------------------------- | | `g:spacevim_enable_neomake` | 1 | Use neomake as default checking tools | -| `g:spacevim_enable_ale` | 1 | Use ale as default checking tools | +| `g:spacevim_enable_ale` | 0 | Use ale as default checking tools | | `g:spacevim_lint_on_the_fly` | 0 | Syntax checking on the fly feature, disabled by default. | **NOTE:** if you want to use ale, you need: @@ -23,10 +38,11 @@ let g:spacevim_enable_ale = 1 and if you want to use syntastic, set this two options to 0. -## Mappings +## Key bindings | Key | mode | description | | --------- | ------ | ------------------------------------------------------------ | +| `SPC e .` | Normal | open error-transient-state | | `SPC e c` | Normal | clear errors | | `SPC e h` | Normal | describe current checker | | `SPC e n` | Normal | jump to the position of next error |