1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:00:04 +08:00

Improve checker layer doc

This commit is contained in:
wsdjeg 2017-05-15 23:22:54 +08:00
parent 973116b6fc
commit a14ef64149
4 changed files with 44 additions and 6 deletions

View File

@ -18,6 +18,9 @@ endfunction
function! SpaceVim#layers#checkers#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['e', '.'], 'lopen', 'error-transient-state', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'c'], '', 'clear all errors', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'h'], '', 'describe a syntax checker', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'v'], '', 'verify syntax checker setup', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'n'], 'lnext', 'next-error', 1)
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)

View File

@ -59,6 +59,9 @@ function! SpaceVim#layers#ui#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['T', '~'], 'call call('
\ . string(s:_function('s:toggle_end_of_buffer')) . ', [])',
\ 'display ~ in the fringe on empty lines', 1)
call SpaceVim#mapping#space#def('nnoremap', ['t', 's'], 'call call('
\ . string(s:_function('s:toggle_syntax_checker')) . ', [])',
\ 'toggle syntax checker', 1)
endfunction
" function() wrapper
if v:version > 703 || v:version == 703 && has('patch1170')
@ -110,7 +113,7 @@ endfunction
let s:fcflag = 0
function! s:toggle_fill_column() abort
if !s:fcflag
let &colorcolumn=join(range(80,999),",")
let &colorcolumn=join(range(80,999),',')
let s:fcflag = 1
else
set cc=
@ -173,3 +176,7 @@ function! s:toggle_win_fringe() abort
let s:tfflag = 0
endif
endfunction
function! s:toggle_syntax_checker() abort
let g:_spacevim_toggle_syntax_flag = g:_spacevim_toggle_syntax_flag * -1
endfunction

View File

@ -1,18 +1,23 @@
if get(g:, 'spacevim_lint_on_save', 0)
augroup Neomake_on_save
au!
autocmd! BufWritePost * Neomake
autocmd! BufWritePost * call s:neomake()
augroup END
endif
if empty(maparg('<leader>ck', '',0,1))
nnoremap <silent> <Leader>ck :Neomake<CR>
endif
let g:_spacevim_toggle_syntax_flag = 1
function! s:neomake() abort
if g:_spacevim_toggle_syntax_flag == 1
Neomake
endif
endfunction
if get(g:, 'spacevim_lint_on_the_fly', 0)
let g:neomake_tempfile_enabled = 1
let g:neomake_open_list = 0
augroup Neomake_on_the_fly
au!
autocmd! TextChangedI * Neomake
autocmd! TextChangedI * call s:neomake()
augroup END
endif

View File

@ -48,6 +48,7 @@ title: "Documentation"
* [Searching](#searching)
* [Editing](#editing)
* [Multi-Encodings](#multi-encodings)
* [Errors handling](#errors-handling)
* [Features](#features)
* [Awesome ui](#awesome-ui-1)
* [Mnemonic key bindings](#mnemonic-key-bindings)
@ -461,9 +462,31 @@ set enc=utf-8
write
```
### Errors handling
SpaceVim uses [neomake](https://github.com/neomake/neomake) to gives error feedback on the fly. The checks are only performed at save time by default.
Errors management mappings (start with e):
Mappings | Description
-------- | -----------
`SPC t s` | toggle syntax checker
`SPC e c` | clear all errors
`SPC e h` | describe a syntax checker
`SPC e l` | toggle the display of the list of errors/warnings
`SPC e n` | go to the next error
`SPC e p` | go to the previous error
`SPC e v` | verify syntax checker setup (useful to debug 3rd party tools configuration)
`SPC e .` | error transient state
The next/previous error mappings and the error transient state can be used to browse errors from syntax checkers as well as errors from location list buffers, and indeed anything that supports vim's location list. This includes for example search results that have been saved to a location list buffer.
Custom sign symbol:
Symbol | Description | Custom option
------ | ----------- | -------------
`✖` | Error | `g:spacevim_error_symbol`
`➤` | warning | `g:spacevim_warning_symbol`
## Features