Skip to content

Latest commit

 

History

History
99 lines (81 loc) · 4.33 KB

README.org

File metadata and controls

99 lines (81 loc) · 4.33 KB

crystal layer

img/crystal.png

Table of Contents

Description

This layer provides support for the Crystal language.

Features:

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add crystal to the existing dotspacemacs-configuration-layers list in this file.

REPL

To be able to connect to inf-crystal, you need to make sure that icr is installed.

Installation instructions can be found on the main page of icr.

Although not in the installation instruction it seems that on macOS you can install it with Homebrew:

brew install crystal-icr

Ameba

To be able to use ameba.el, you need to make sure that ameba is installed.

Installation instructions can be found on the main page of ameba.

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add crystal to the existing dotspacemacs-configuration-layers list in this file.

Key bindings

Crystal commands

Key bindingDescription
SPC m e bplay-crystal submit buffer
SPC m e eplay-crystal show code in a browser
SPC m e idownload play-crystal snippet
SPC m e rplay-crystal submit region
SPC m g Gjump to definition in other window
SPC m g ajump to matching spec file or back from spec to code file
SPC m g gjump to definition
SPC m t brun crystal spec for the current buffer
SPC m t prun crystal spec for the current project
SPC m u cshow context
SPC m u eshow macro expansion
SPC m u fformat the current buffer
SPC m u ishow implementations for given call
SPC m x xrun crystal run for the current file

REPL

Start a inferior crystal REPL process with SPC m '​ or SPC m s i. Send code to inferior process commands:

Key bindingDescription
SPC m '​start inferior REPL process
SPC m s Bsend buffer and switch to REPL
SPC m s Fsend function definition and switch to REPL
SPC m s Rsend region and switch to REPL
SPC m s bsend buffer
SPC m s fsend function definition
SPC m s istart inferior REPL process
SPC m s rsend region
SPC m s sswitch to REPL

Ameba

Key bindingDescription
SPC m a dPrompts from a directory on which to run Ameba
SPC m a fRuns Ameba on the current visited file
SPC m a pRuns Ameba on the entire project