2017-12-23 14:56:31 +08:00
---
2018-04-21 07:14:12 +08:00
title: "SpaceVim lang#haskell layer"
2019-02-03 20:51:01 +08:00
description: "Haskell language support for SpaceVim, includes code completion, syntax checking, jumping to definition, also provides language server protocol support for Haskell"
2017-12-23 14:56:31 +08:00
---
2018-06-23 14:37:41 +08:00
# [Available Layers](../../) >> lang#haskell
2017-12-23 14:56:31 +08:00
<!-- vim - markdown - toc GFM -->
- [Description ](#description )
2018-06-23 14:37:41 +08:00
- [Install ](#install )
2017-12-23 14:56:31 +08:00
- [Features ](#features )
2020-01-20 16:20:50 +08:00
- [Key bindings ](#key-bindings )
- [Running current script ](#running-current-script )
- [Inferior REPL process ](#inferior-repl-process )
2017-12-23 14:56:31 +08:00
<!-- vim - markdown - toc -->
## Description
2020-01-20 16:20:50 +08:00
This layer is for Haskell development. This layer includes following plugins:
- haskell.vim: syntax highlight and indent
- vim-syntax-shakespeare: syntax files for the shakespeare templating languages
- neco-ghc: completion plugin for Haskell
2017-12-23 14:56:31 +08:00
2018-06-23 14:37:41 +08:00
## Install
2017-12-23 14:56:31 +08:00
2021-06-21 20:39:29 +08:00
To use this configuration layer, update your custom configuration file with:
2018-06-23 14:37:41 +08:00
```toml
[[layers]]
name = "lang#haskell"
```
2017-12-23 14:56:31 +08:00
2020-01-20 16:20:50 +08:00
After updating configuration file, restart SpaceVim and run `:SPInstall` .
2017-12-23 14:56:31 +08:00
## Features
2020-01-20 16:20:50 +08:00
- code completion
2017-12-23 14:56:31 +08:00
- syntax checking
- goto definition
- refernce finder
2019-01-07 21:15:22 +08:00
- language server protocol (need lsp layer)
2017-12-23 14:56:31 +08:00
2020-01-20 16:20:50 +08:00
## Key bindings
### Running current script
2021-06-21 20:39:29 +08:00
To run a haskell file, you can press `SPC l r` to run the current file
without losing focus, and the result will be shown in a runner buffer.
2020-01-20 16:20:50 +08:00
### Inferior REPL process
Start a `ghci` inferior REPL process with `SPC l s i` .
Send code to inferior process commands:
| Key Bindings | Descriptions |
| ------------ | ------------------------------------------------ |
| `SPC l s b` | send buffer and keep code buffer focused |
| `SPC l s l` | send line and keep code buffer focused |
| `SPC l s s` | send selection text and keep code buffer focused |