Emacs

spork-lang 0.6.0

Install spork-mode and use nREPL evaluation, documentation, navigation, inspection, and completion.

spork-mode is an Emacs major mode for Spork with nREPL integration. It provides interactive evaluation, navigation, completion, and inspection for Spork source.

Requirements#

Installation#

Manual#

  1. Add the checked-out spork-lang/editors/emacs directory to your Emacs load path, or copy spork-mode.el into an existing load-path directory.
  2. Load the mode from your init file:
(add-to-list 'load-path "/path/to/spork-lang/editors/emacs")
(require 'spork-mode)

use-package#

(use-package spork-mode
  :load-path "/path/to/spork-lang/editors/emacs"
  :mode "\\.spork\\'")

Features#

Core Features#

Runtime Features#

Usage#

Getting Started#

  1. Open a .spork file (spork-mode activates automatically)
  2. Start the nREPL server with M-x spork-jack-in or C-c C-j
  3. Start evaluating code!

Alternatively, connect to an existing nREPL server:

M-x spork-connect

Key Bindings#

Connection#

KeyCommandDescription
C-c C-jspork-jack-inStart server and connect
C-c C-qspork-quitQuit connection

Evaluation#

KeyCommandDescription
C-c C-cspork-eval-current-sexpEval form at point
C-c C-espork-eval-last-sexpEval form before point
C-c C-rspork-eval-regionEval region
C-c C-bspork-eval-bufferEval entire buffer
C-c C-kspork-load-current-bufferLoad current buffer
C-c C-zspork-switch-to-replSwitch to REPL buffer

Namespaces#

KeyCommandDescription
C-c C-nspork-set-nsSwitch to namespace
C-c nspork-current-nsShow current namespace
C-c C-S-nspork-list-nsList all namespaces

Documentation & Info#

KeyCommandDescription
C-c C-dspork-docShow documentation
C-c ispork-infoShow rich info (type, arglists)
C-c C-mspork-macroexpandMacroexpand form at point
C-c C-tspork-transpileTranspile form to Python
C-c C-pspork-list-protocolsList all protocols
KeyCommandDescription
M-.spork-find-definitionJump to definition
M-,spork-pop-find-definition-stackPop back from definition
C-c gspork-find-definitionJump to definition (alt)
C-c bspork-pop-find-definition-stackPop back (alt)

Inspector#

KeyCommandDescription
C-c C-ispork-inspect-last-sexpInspect last sexp

In Inspector buffer:

KeyCommandDescription
nspork-inspector-nav-indexNavigate by index
kspork-inspector-nav-keyNavigate by key
bspork-inspector-backGo back
qspork-inspector-quitQuit inspector
RETspork-inspector-nav-indexNavigate by index

Customization#

;; REPL buffer name
(setq spork-repl-buffer "*spork-repl*")

;; Default nREPL host
(setq spork-default-host "127.0.0.1")

;; Default nREPL port
(setq spork-default-port 7888)

;; Spork CLI command
(setq spork-command "spork")

Source#

The integration source is maintained in the spork-lang editor directory.