mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:40:06 +08:00
2.9 KiB
2.9 KiB
title | description |
---|---|
SpaceVim lang#purescript layer | This layer is for PureScript development, provides autocompletion, syntax checking, and code formatting for PureScript files. |
Available Layers >> lang#purescript
Description
This layer is for Purescript development. PureScript is a strongly-typed functional programming language that compiles to JavaScript.
Features
- Completion for Modules and functions.
- Documentation lookup for Modules and functions.
- Jump to the definition.
SpaceVim also provides REPL, code runner and Language Server protocol support for PureScript. To enable language server protocol
for PureScript, you need to load lsp
layer for PureScript.
Install
Get the compiler and recommended tools
npm install -g purescript
npm install -g pulp bower
Layer
To use this configuration layer, update your custom configuration file with:
[[layers]]
name = "lang#purescript"
Key bindings
Language specific key bindings
Key Bindings | Descriptions |
---|---|
g d |
Goto identifier. |
SPC l L |
list loaded modules |
SPC l l |
reset loaded modules and load externs |
SPC l r |
run the current project |
SPC l R |
rubuild current buffer |
SPC l f |
generate function template |
SPC l t |
add type annotation |
SPC l a |
apply current line suggestion |
SPC l A |
apply all suggestions |
SPC l C |
add case expression |
SPC l i |
import module under cursor |
SPC l p |
search pursuit for cursor ident |
SPC l T |
find type for cursor ident |
Inferior REPL process
Start a pulp repl
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 |
Running current script
To run the current script, you can press SPC l r
to run the current file without losing focus, and the result will be shown in a runner buffer.