spacemacs/layers/+lang/racket
syl20bnr 2cb98447af Move evil-cleverparens to spacemacs-evil with major mode toggle
Delete layer evil-cleverparens and move the package to spacemacs-evil layer.

The feature is called "Safe structurral editing" for lisp dialects. Support for
it is added via pre-init functions in each of the concerned layer and proper
documentation is added to their README.org files.

This also removes the recently added package evil-smartparens. The goal is
to choose the best package for evil safe structural editing. For now we use
evil-cleverparens as we supported it first, if evil-smartparens is shown to be
a better package we will be able to switch to it.
2018-01-04 01:40:52 -05:00
..
img Use + instead of ! for layer categories 2015-09-11 00:13:51 -04:00
config.el Bump year in copyright headers 2017-01-05 23:08:17 -05:00
packages.el Move evil-cleverparens to spacemacs-evil with major mode toggle 2018-01-04 01:40:52 -05:00
README.org Move evil-cleverparens to spacemacs-evil with major mode toggle 2018-01-04 01:40:52 -05:00

Racket layer

/TakeV/spacemacs/media/commit/2cb98447afa3230d579d349b42e03c23017f43f5/layers/+lang/racket/img/racket.png

Description

Adds support for the Racket programming language.

Features:

  • Syntax highlighting with racket-mode
  • Test runner
  • Interactive REPL
  • Code navigation with gtags
  • Structuraly safe editing using optional evil-cleverparens

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add racket to the existing dotspacemacs-configuration-layers list in this file. You will also need DrRacket installed. Alternatively, one can use the "Minimal Racket" installation, and then run the following command.

raco pkg install drracket

Structuraly safe editing

This layer add support for evil-cleverparens which allows safely edit lisp code by keeping the s-expressions balanced.

By default this mode is not activated. You can turn it on locally on a the active buffer with SPC m T s (s for safe).

To turn it on automatically for all racket buffers call the following function in your dotspacemacs/user-config function:

(spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hook-racket-mode)

or to enable it for all supported modes:

(spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hooks)

When enabled the symbol 🆂 should be displayed in the mode-line.

Key Bindings

Navigation

Key Binding Description
SPC m g ` Return to previous location
SPC m g g Go to definition of symbol at point
SPC m g m Go to module at point
SPC m g r Open require path

Documentation

Key Binding Description
SPC m h d Describes the function at point in a Racket Describe buffer
SPC m h h View documentation of the identifier or string at point.

Tests

Key Binding Description
SPC m t b Run tests of buffer
SPC m t B Run tests of buffer with coverage

REPL

Key Binding Description
SPC m s b Send buffer to REPL
SPC m s B Send buffer to REPL and switch to REPL buffer in insert state
SPC m s e Send last sexp to REPL
SPC m s E Send last sexp to REPL and switch to REPL in insert state
SPC m s f Send function at point to REPL
SPC m s F Send function at point and switch to REPL in insert state
SPC m s i Start a REPL or switch to REPL buffer
SPC m s r Send region to REPL
SPC m s R Send region to REPL and switch to REPL in insert state
SPC m s s Show and switch to REPL buffer

Other key bindings

Key Binding Description
SPC m i l Insert lambda character
H-r Run current file and open REPL (H is hyper, may be bound to command on OSX)