diff --git a/autoload/SpaceVim/layers/checkers.vim b/autoload/SpaceVim/layers/checkers.vim index 3f6128c82..b1a38e994 100644 --- a/autoload/SpaceVim/layers/checkers.vim +++ b/autoload/SpaceVim/layers/checkers.vim @@ -21,6 +21,8 @@ " - `lint_on_the_fly`: Syntax checking on the fly feature, disabled by default. " - `lint_on_save`: Run syntax checking when saving a file. " - `show_cursor_error`: Enable/Disable displaying error below current line. +" - `lint_exclude_filetype`: Set the filetypes which does not enable syntax +" checking. if exists('s:show_cursor_error') @@ -33,6 +35,8 @@ else let s:show_cursor_error = 0 endif +let s:lint_exclude_filetype = [] + let s:SIG = SpaceVim#api#import('vim#signatures') let s:STRING = SpaceVim#api#import('data#string') @@ -59,6 +63,7 @@ function! SpaceVim#layers#checkers#set_variable(var) abort let s:show_cursor_error = get(a:var, 'show_cursor_error', 1) let s:lint_on_the_fly = get(a:var, 'lint_on_the_fly', 1) + let s:lint_exclude_filetype = get(a:var, 'lint_exclude_filetype', []) if s:show_cursor_error && !has('timers') call SpaceVim#logger#warn('show_cursor_error in checkers layer needs timers feature') @@ -80,6 +85,11 @@ function! SpaceVim#layers#checkers#config() abort let g:neomake_cursormoved_delay = get(g:, 'neomake_cursormoved_delay', 300) let g:neomake_virtualtext_current_error = get(g:, 'neomake_virtualtext_current_error', !s:show_cursor_error) + " exclude filetypes: + for ft in s:lint_exclude_filetype + let g:neomake_{ft}_enabled_makers = [] + endfor + elseif g:spacevim_lint_engine ==# 'ale' let g:ale_echo_delay = get(g:, 'ale_echo_delay', 300) endif diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 824bdbad7..84439f5e7 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -1655,6 +1655,8 @@ OPTIONS `lint_on_the_fly`: Syntax checking on the fly feature, disabled by default. `lint_on_save`: Run syntax checking when saving a file. `show_cursor_error`: Enable/Disable displaying error below current line. +`lint_exclude_filetype`: Set the filetypes which does not enable syntax + checking. ============================================================================== COLORSCHEME *SpaceVim-layers-colorscheme* diff --git a/docs/layers/checkers.md b/docs/layers/checkers.md index 85851faf6..c5aef7ff5 100644 --- a/docs/layers/checkers.md +++ b/docs/layers/checkers.md @@ -51,11 +51,12 @@ you can use vim script. For all the info about neomake configuration, please che By default, the error will be displayed below the current line, if you want to disabled this feature, you may need to load this layer with `show_cursor_error` to `false`. -| Name | default value | description | -| ------------------- | ------------- | -------------------------------------------------------- | -| `lint_on_the_fly` | `false` | Syntax checking on the fly feature, disabled by default. | -| `lint_on_save` | `true` | Run syntax checking when saving a file. | -| `show_cursor_error` | `true` | Enable/Disable displaying error below current line. | +| Name | default value | description | +| ----------------------- | ------------- | -------------------------------------------------------- | +| `lint_on_the_fly` | `false` | Syntax checking on the fly feature, disabled by default. | +| `lint_on_save` | `true` | Run syntax checking when saving a file. | +| `show_cursor_error` | `true` | Enable/Disable displaying error below current line. | +| `lint_exclude_filetype` | `[]` | Set the filetypes which does not enable syntax checking. | ```toml [[layers]]