Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

brantou/spacemacs-crystal-layer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crystal layer

img/crystal.png

Table of Contents

Description

This layer provides support for the Crystal language with the following features:

Install

Pre-requires

Because the spacemacs master and develop branches are not compatible, so this project has two branches:

  • master -> spacemacs master branch
  • develop -> spacemacs develop branch

Clone this repository into your ~/.emacs.d/private directory:

  • spacemacs using master branch
    git clone [email protected]:brantou/spacemacs-crystal-layer.git ~/.emacs.d/private/crystal
        
  • spacemacs using develop branch
    git clone -b develop [email protected]:brantou/spacemacs-crystal-layer.git ~/.emacs.d/private/crystal
        

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.

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 rplay-crystal submit region
SPC m e eplay-crystal show code in a browser
SPC m e idownload play-crystal snippet
SPC m g ajump to matching spec file or back from spec to code file
SPC m g gjump to definition
SPC m g Gjump to definition in other window
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

inf-crystal

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
SPC m s Bsend buffer and switch to REPL
SPC m s fsend function definition
SPC m s Fsend function definition and switch to REPL
SPC m s istart inferior REPL process
SPC m s rsend region
SPC m s Rsend region and switch to REPL
SPC m s sswitch to REPL

ameba

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