brantou / spacemacs-crystal-layer

Spacemacs layer for Crystal
GNU General Public License v3.0
9 stars 1 forks source link
crystal-language spacemacs-layer spacemacs-private

+TITLE: crystal layer

[[file:img/crystal.png]]

** Pre-requires :PROPERTIES: :ID: 31dbc2e1-829e-41b6-9e0f-0a124476bb4d :END:

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

** Layer :PROPERTIES: :ID: 22d52a72-aae2-44b9-87df-a81c67007fd5 :END: 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.

** Crystal commands: :PROPERTIES: :ID: af7863ff-8086-4ebd-b643-3423438871be :END:

| Key Binding | Description | |-------------+-----------------------------------------------------------| | ~SPC m e b~ | play-crystal submit buffer | | ~SPC m e r~ | play-crystal submit region | | ~SPC m e e~ | play-crystal show code in a browser | | ~SPC m e i~ | download play-crystal snippet | | ~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 g G~ | jump to definition in other window | | ~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 |

** inf-crystal :PROPERTIES: :ID: 531e86e4-88bb-4bbd-a3c7-94edddcbe944 :END:

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 | | ~SPC m s B~ | send buffer and switch to REPL | | ~SPC m s f~ | send function definition | | ~SPC m s F~ | send function definition and switch to REPL | | ~SPC m s i~ | start inferior REPL process | | ~SPC m s r~ | send region | | ~SPC m s R~ | send region and switch to REPL | | ~SPC m s s~ | switch to REPL |

** ameba :PROPERTIES: :ID: 414b5c9b-f3f7-4027-bea0-2cc774852b3b :END:

| Key Binding | Description | |-------------+------------------------------------------------| | ~SPC m a f~ | Runs Ameba on the current visited file | | ~SPC m a d~ | Prompts from a directory on which to run Ameba | | ~SPC m a p~ | Runs Ameba on the entire project |