1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 02:20:03 +08:00
SpaceVim/docs/layers/checkers.md

85 lines
3.5 KiB
Markdown
Raw Normal View History

2017-10-25 10:27:25 +08:00
---
title: "SpaceVim checkers layer"
description: "Syntax checking automatically within SpaceVim, display error on the sign column and statusline."
2017-10-25 10:27:25 +08:00
---
2018-06-23 14:37:41 +08:00
# [Available Layers](../) >> checkers
2017-10-25 10:27:25 +08:00
<!-- vim-markdown-toc GFM -->
- [Description](#description)
2018-06-23 14:37:41 +08:00
- [Install](#install)
2017-10-25 10:27:25 +08:00
- [Configuration](#configuration)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
2017-05-11 21:10:20 +08:00
This layer provides syntax checking feature.
2018-06-23 14:37:41 +08:00
## Install
2017-05-11 21:10:20 +08:00
2018-06-23 14:37:41 +08:00
To use this configuration layer, add following snippet to your custom configuration file.
2021-02-10 10:31:34 +08:00
This layer is enabled by default.
2018-06-23 14:37:41 +08:00
```toml
[[layers]]
name = "checkers"
```
2017-05-11 21:10:20 +08:00
2017-10-25 10:27:25 +08:00
## Configuration
2017-05-11 21:10:20 +08:00
2021-06-21 20:39:29 +08:00
The checkers layer is loaded by default, there are two kinds options for this layer:
global options and layer options.
2018-01-03 21:15:12 +08:00
2018-06-23 14:37:41 +08:00
**Global options:**
2021-06-21 20:39:29 +08:00
All of the SpaceVim global options should be put into the `[options]` section.
2018-01-03 21:15:12 +08:00
2021-02-10 10:31:34 +08:00
| Name | default value | description |
| ------------- | ------------- | ------------------- |
| `lint_engine` | `neomake` | Set the lint engine |
The default lint engine is `neomake`, you can also use `ale` or `syntastic`.
2017-05-11 21:14:48 +08:00
2021-06-21 20:39:29 +08:00
If you want to configure neomake, you can use bootstrap functions. Within bootstrap functions,
2020-09-24 00:23:11 +08:00
you can use vim script. For all the info about neomake configuration, please checkout `:h neomake`.
2021-02-10 10:31:34 +08:00
**Layer options:**
2021-06-21 20:39:29 +08:00
By default, the error will be displayed below the current line, if you want to disabled this
2021-02-10 10:31:34 +08:00
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. |
| `lint_exclude_filetype` | `[]` | Set the filetypes which does not enable syntax checking. |
| `open_error_list` | `1/2/0` | Open the language checking windows. Defaults to 2 |
2017-10-25 09:53:05 +08:00
2018-06-23 14:37:41 +08:00
```toml
2021-02-10 10:31:34 +08:00
[[layers]]
name = "checkers"
show_cursor_error = false
2017-10-25 09:53:05 +08:00
```
2017-05-11 21:14:48 +08:00
2017-10-25 10:27:25 +08:00
## Key bindings
2017-05-11 21:14:48 +08:00
2017-10-25 09:53:05 +08:00
| Key | mode | description |
| --------- | ------ | ------------------------------------------------------------ |
2017-10-25 10:27:25 +08:00
| `SPC e .` | Normal | open error-transient-state |
2017-10-25 09:53:05 +08:00
| `SPC e c` | Normal | clear errors |
| `SPC e h` | Normal | describe current checker |
| `SPC e n` | Normal | jump to the position of next error |
| `SPC e N` | Normal | jump to the position of previous error |
| `SPC e p` | Normal | jump to the position of previous error |
| `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 |
2018-06-23 14:37:41 +08:00
| `SPC e s` | Normal | set syntax checker (TODO) |
| `SPC e S` | Normal | set syntax checker executable (TODO) |
2017-10-25 09:53:05 +08:00
| `SPC e v` | Normal | verify syntax setup |
| `SPC t s` | Normal | toggle syntax |