Table of Contents

crystal layer

Table of ContentsClose

crystal.png

1 Description

This layer provides support for the Crystal language.

1.1 Features:

2 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.

2.1 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

2.2 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.

2.3 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.

3 Key bindings

3.1 Crystal commands

Key binding Description
SPC m e b play-crystal submit buffer
SPC m e e play-crystal show code in a browser
SPC m e i download play-crystal snippet
SPC m e r play-crystal submit region
SPC m g G jump to definition in other window
SPC m g a jump to matching spec file or back from spec to code file
SPC m g g jump to definition
SPC m t b run crystal spec for the current buffer
SPC m t p run crystal spec for the current project
SPC m u c show context
SPC m u e show macro expansion
SPC m u f format the current buffer
SPC m u i show implementations for given call
SPC m x x run crystal run for the current file

3.2 REPL

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

Key binding Description
~SPC m '​~ start inferior REPL process
SPC m s B send buffer and switch to REPL
SPC m s F send function definition and switch to REPL
SPC m s R send region and switch to REPL
SPC m s b send buffer
SPC m s f send function definition
SPC m s i start inferior REPL process
SPC m s r send region
SPC m s s switch to REPL

3.3 Ameba

Key binding Description
SPC m a d Prompts from a directory on which to run Ameba
SPC m a f Runs Ameba on the current visited file
SPC m a p Runs Ameba on the entire project

Author: root

Created: 2019-11-10 Sun 14:17

Validate