Skip to content

vkocubinsky/clojure-repl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

clojure-repl.el: Clojure REPL interaction

Note: This documentation is incomplete, may be unreliable, and should be considered as a draft.

This package provides basic interaction with a Clojure subprocess (REPL). It’s based on ideas from inferior-lisp and inf-clojure packages. clojure-repl provides a set of essential features for interactive Clojure development:

  • REPL
  • Interactive code evaluation
  • Definition lookup
  • Documentation lookup
  • Macroexpansion
  • Run tests
  • Automatically switch namespace
  • Automatically load namespace
  • Automatically install repl functions
  • Print stack trace
  • Echo executed commands
  • Multiple projects support

**Note:** Package clojure-repl evaluate current sexp instead of last sexp.

Flows

There are two major flows for work with package

  • Automatically load everything(DEFAULT)
  • Manually load namespace, call in-ns, install repl

Installation

Currently, the recommended ways to install clojure-repl are with use-package and :vc, or from a local checkout.

Install with use-package and vc

(use-package clojure-repl
  :vc (:url "https://github.com/vkocubinsky/clojure-repl"
       :rev :newest)
  :hook (clojure-mode . clojure-repl-minor-mode))

Install from local source checkout

(use-package clojure-repl
  :load-path "/path-to-repo/clojure-repl"
  :hook (clojure-mode . clojure-repl-minor-mode))

Keybinding

Keybinding for clojure buffer

BindingCommand
C-M-xclojure-repl-eval-defun
C-c C-cclojure-repl-eval-paragraph
C-x C-eclojure-repl-eval-sexp
C-c C-eclojure-repl-eval-sexp
C-c C-pclojure-repl-pprint-sexp
C-c C-bclojure-repl-eval-buffer
C-c C-rclojure-repl-eval-region
C-c C-oclojure-repl-clear-repl-buffer
C-c C-zclojure-repl-switch-to-repl
C-c C-qclojure-repl-quit
C-c C-nclojure-repl-switch-ns
C-c C-kclojure-repl-reload
C-c C-l fclojure-repl-load-file
C-c C-l lclojure-repl-load
C-c C-l rclojure-repl-reload
C-c C-l aclojure-repl-reload-all
C-c C-l tclojure-repl-load-repl
C-c C-t aclojure-repl-run-all-tests
C-c C-t nclojure-repl-run-ns-tests
C-c C-t tclojure-repl-run-test
C-c C-jclojure-repl-javadoc
C-c C-aclojure-repl-show-pst
C-c C-mclojure-repl-macroexpand
C-c C-vclojure-repl-show-var-doc
C-c C-sclojure-repl-show-var-source

Keybinding for REPL buffer

BindingCommand
C-x C-eclojure-repl-eval-sexp
C-c C-l tclojure-repl-load-repl
C-c C-vclojure-repl-show-var-doc
C-c C-sclojure-repl-show-var-source
C-c C-oclojure-repl-clear-repl-buffer
C-c C-qclojure-repl-quit
C-c C-zclojure-repl-switch-to-recent-buffer

Configuration

The following variables can be customized to control how clojure-repl behaves.

VariableDescription
clojure-repl-programProgram name used to start the Clojure REPL.
clojure-repl-echoWhen non-nil, commands executed from a Clojure buffer are inserted into the REPL buffer before being sent.
clojure-repl-auto-load-replAutomatically load REPL helper functions.
clojure-repl-auto-loadAutomatically load the current namespace before evaluation commands.
clojure-repl-auto-switch-nsAutomatically switch the REPL to the current buffer namespace.
clojure-repl-repl-use-same-windowShow the REPL buffer in the current window instead of another window.
clojure-repl-auto-modeAutomatically enable clojure-repl-minor-mode in clojure-mode buffers.
clojure-repl-comint-prompt-regexpRegexp used to recognize prompts in the REPL buffer.
(use-package clojure-repl
:vc (:url "https://github.com/vkocubinsky/clojure-repl"
     :rev :newest)
:hook (clojure-mode . clojure-repl-minor-mode)
:custom
(clojure-repl-program "clojure -A:dev")
(clojure-repl-echo t)
(clojure-repl-auto-load nil)
(clojure-repl-auto-load-repl nil)
(clojure-repl-auto-switch-ns nil))

About

Comint mode for Clojure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors