2017-10-25 10:27:25 +08:00
|
|
|
---
|
|
|
|
title: "SpaceVim checkers layer"
|
2018-05-12 19:01:00 +08:00
|
|
|
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.
|
|
|
|
|
|
|
|
```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
|
|
|
|
2018-06-23 14:37:41 +08:00
|
|
|
**Layer options:**
|
2018-01-03 21:15:12 +08:00
|
|
|
|
2018-06-23 14:37:41 +08:00
|
|
|
By default, the error will be display below current line, if you want to disabled this
|
|
|
|
feature, you may need to load this layer with `show_cursor_error` to `false`.
|
|
|
|
|
|
|
|
```toml
|
|
|
|
[[layers]]
|
|
|
|
name = "checkers"
|
|
|
|
show_cursor_error = false
|
2018-01-03 21:15:12 +08:00
|
|
|
```
|
|
|
|
|
2018-06-23 14:37:41 +08:00
|
|
|
**Global options:**
|
|
|
|
|
|
|
|
the following options are SpaceVim option, you need to config them in `[options]` section.
|
2018-01-03 21:15:12 +08:00
|
|
|
|
2018-06-23 14:37:41 +08:00
|
|
|
| Name | default value | description |
|
|
|
|
| ----------------- | ------------- | -------------------------------------------------------- |
|
2020-09-24 00:23:11 +08:00
|
|
|
| `enable_neomake` | `true` | Use [neomake](https://github.com/neomake/neomake) as default checking tools |
|
2018-06-23 14:37:41 +08:00
|
|
|
| `enable_ale` | `false` | Use ale as default checking tools |
|
|
|
|
| `lint_on_the_fly` | `false` | Syntax checking on the fly feature, disabled by default. |
|
2017-05-11 21:14:48 +08:00
|
|
|
|
2020-09-24 00:23:11 +08:00
|
|
|
If you want to config neomake, you can use bootstrap functions. Within bootstrap functions,
|
|
|
|
you can use vim script. For all the info about neomake configuration, please checkout `:h neomake`.
|
|
|
|
|
2017-10-25 09:53:05 +08:00
|
|
|
**NOTE:** if you want to use ale, you need:
|
|
|
|
|
2018-06-23 14:37:41 +08:00
|
|
|
```toml
|
|
|
|
[options]
|
|
|
|
enable_neomake = false
|
|
|
|
enable_ale = true
|
2017-10-25 09:53:05 +08:00
|
|
|
```
|
2017-05-11 21:14:48 +08:00
|
|
|
|
2018-06-23 14:37:41 +08:00
|
|
|
and if you want to use syntastic, set this two options to `false`.
|
2017-10-25 09:53:05 +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 |
|