From 62c340268713289bccd3ec3008e2a7e808e9fa6b Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 25 Oct 2017 22:56:21 +0800 Subject: [PATCH] Add mappings --- autoload/SpaceVim/layers/checkers.vim | 12 ++++++++++++ docs/layers/checkers.md | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/layers/checkers.vim b/autoload/SpaceVim/layers/checkers.vim index f01d62231..91d2dea71 100644 --- a/autoload/SpaceVim/layers/checkers.vim +++ b/autoload/SpaceVim/layers/checkers.vim @@ -29,11 +29,23 @@ function! SpaceVim#layers#checkers#config() abort call SpaceVim#mapping#space#def('nnoremap', ['e', 'L'], 'lopen', 'toggle showing the error list', 1) call SpaceVim#mapping#space#def('nnoremap', ['e', 'p'], 'lprevious', 'previous-error', 1) call SpaceVim#mapping#space#def('nnoremap', ['e', 'N'], 'lNext', 'previous-error', 1) + call SpaceVim#mapping#space#def('nnoremap', ['e', 'v'], 'call call(' + \ . string(s:_function('s:verify_syntax_setup')) . ', [])', + \ 'verify syntax setup', 1) call SpaceVim#mapping#space#def('nnoremap', ['e', '.'], 'call call(' \ . string(s:_function('s:error_transient_state')) . ', [])', \ 'error-transient-state', 1) endfunction + +function! s:verify_syntax_setup() abort + if g:spacevim_enable_neomake + NeomakeInfo + elseif g:spacevim_enable_ale + else + endif +endfunction + function! s:error_transient_state() abort if g:spacevim_enable_neomake let has_errors = neomake#statusline#LoclistCounts() diff --git a/docs/layers/checkers.md b/docs/layers/checkers.md index c55ab8444..a72642cff 100644 --- a/docs/layers/checkers.md +++ b/docs/layers/checkers.md @@ -51,7 +51,7 @@ and if you want to use syntastic, set this two options to 0. | `SPC e l` | Normal | display a list of all the errors | | `SPC e L` | Normal | display a list of all the errors and focus the errors buffer | | `SPC e e` | Normal | explain the error at point | -| `SPC e s` | Normal | set syntax checker | -| `SPC e S` | Normal | set syntax checker executable | +| `SPC e s` | Normal | set syntax checker (TODO) | +| `SPC e S` | Normal | set syntax checker executable (TODO) | | `SPC e v` | Normal | verify syntax setup | | `SPC t s` | Normal | toggle syntax |