marten / spacemacs-crystal-layer

Spacemacs layer for Crystal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 git@github.com:brantou/spacemacs-crystal-layer.git ~/.emacs.d/private/crystal
        
  • spacemacs using develop branch
    git clone -b develop git@github.com: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.

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

About

Spacemacs layer for Crystal

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 100.0%