Back to Spacevim

SpaceVim lang#purescript layer

docs/layers/lang/purescript.md

2.4.02.7 KB
Original Source

Available Layers >> lang#purescript

<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc -->

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

sh
npm install -g purescript
npm install -g pulp bower

Layer

To use this configuration layer, update your custom configuration file with:

toml
[[layers]]
  name = "lang#purescript"

Key bindings

Language specific key bindings

Key BindingsDescriptions
g dGoto identifier.
SPC l Llist loaded modules
SPC l lreset loaded modules and load externs
SPC l rrun the current project
SPC l Rrubuild current buffer
SPC l fgenerate function template
SPC l tadd type annotation
SPC l aapply current line suggestion
SPC l Aapply all suggestions
SPC l Cadd case expression
SPC l iimport module under cursor
SPC l psearch pursuit for cursor ident
SPC l Tfind 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 BindingsDescriptions
SPC l s bsend buffer and keep code buffer focused
SPC l s lsend line and keep code buffer focused
SPC l s ssend 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.