This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/common-lisp
2018-10-11 00:13:43 +03:00
..
img
config.el Happy New Year 2018! 2018-01-04 02:00:25 -05:00
funcs.el Revert "Defer packages by default using use-package-always-defer" 2018-03-03 23:40:10 -05:00
packages.el Fix counsel-gtags package name in common-lisp layer 2018-05-31 23:43:02 -04:00
README.org Reformat documentation 2018-10-11 00:13:43 +03:00

Common Lisp layer

/TakeV/spacemacs/media/commit/75844c04c7b5e4ffd12bfc448481ee17f301f61e/layers/+lang/common-lisp/img/slime.png

Description

This layer provides support for Common Lisp to Spacemacs.

Features:

  • Syntax highlighting
  • Auto-completion using company
  • Repl support via SLIME
  • Support for specific lisp navigation styles via common-lisp-mode
  • Support for sbcl backend or any other common-lisp implementation

Install

If you have previously installed slime in any other way, it is recommended that you uninstall it before proceeding. You should clean up any config files tied to slime that are left behind as well. Linux users can just purge the slime package if it was a distribution install.

To use this configuration layer, add it to your ~/.spacemacs. You will need to add common-lisp to the existing dotspacemacs-configuration-layers list in this file.

This layer defaults to using sbcl. If you want to use a different implementation of Common Lisp, you can specify it in your ~/.spacemacs

  (defun dotspacemacs/user-config ()
    (setq inferior-lisp-program "/path/to/your/lisp"))

Structuraly safe editing

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

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

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

  (spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hook-common-lisp-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

Working with lisp files (barfage, slurpage & more)

Spacemacs comes with a special lisp-state for working with lisp code that supports slurpage, barfage and more tools youll likely want when working with lisp.

As this state works the same for all files, the documentation is in global DOCUMENTATION.org. In general, use SPC k to interact with the lisp-state.

Leader

Help

Key Binding Description
SPC m h a SLIME apropos
SPC m h d Disassemble symbol at point
SPC m h h Describe symbol at point
SPC m h i Inspect definition
SPC m h H Hyperspec lookup symbol at point
SPC m h p Browse apropos results for a packages exported symbols
SPC m h t Toggle tracing of the function at point
SPC m h T Untrace all functions
SPC m h < Show all known callers
SPC m h > Show all known callees
SPC m h m Show all usages of a macro
SPC m h r Show references to global variable
SPC m h s Show all methods specialized on a class

Evaluation

Key Binding Description
SPC m e b Evaluate buffer
SPC m e e Evaluate last sexp
SPC m e l Go to end of line and evaluate last sexp
SPC m e f Evaluate top level sexp
SPC m e F Undefine the function at point
SPC m e r Evaluate region

REPL

Key Binding Description
SPC m s i Start an inferior process
SPC m s e Evaluate last expression in REPL
SPC m s q Quit

Compile

Key Binding Description
SPC m c c Compile file
SPC m c C Compile file and load it
SPC m c l Load file
SPC m c n Remove compilation notes
SPC m c f Compile function
SPC m c r Compile region

Navigation

Key Binding Description
SPC m g g Go to definition
SPC m g b Go back
SPC m g n Next note
SPC m g N or ~SPC m g p Previous note

Macroexpansion

Key Binding Description
SPC m m a Macroexpand the expression at point completly
SPC m m o Macroexpand the expression at point once