Clojure
Lem’s clojure-mode provides syntax highlighting, LSP support and nREPL integration, CIDER-compatible keybindings:
- full-featured Clojure language mode with syntax highlighting, indentation, and LSP integration
- nREPL client for interactive development with eval, macroexpand, and documentation commands
- REPL mode with history, namespace tracking, and connection management
- Clojure-specific tools: inspector, test runner, stacktrace navigation, and detective integration
With a comprehensive test suite covering the bencode protocol, indentation, and mode functionality.
- syntax highlighting for Clojure/ClojureScript/EDN files
- Clojure-specific indentation with customizable rules
- rainbow parentheses support
- namespace detection and tracking, display namespace in modeline
- file type support:
.clj,.cljs,.cljc,.cljx,.edn
- full nREPL protocol implementation using bencode
- interactive REPL with command history
- connection management (
nrepl-connect,nrepl-disconnect) - session handling (
nrepl-clone-session,nrepl-close-session) - async/sync message sending
- eval commands:
clojure-eval-last-sexp,clojure-eval-defun,clojure-eval-region,clojure-eval-buffer - macroexpand support:
clojure-macroexpand-1,clojure-macroexpand-all - documentation lookup:
clojure-describe-symbol
- Inspector (
inspector.lisp): Browse Clojure data structures interactively - Test Runner (
test-runner.lisp): Run tests with results display and navigation - Stacktrace (
stacktrace.lisp): Navigate exceptions with source jumping - Detective (
detective.lisp): Context menu integration for Clojure-specific actions - Tools (
tools.lisp): Code actions, refactoring, and utilities
- integration with clojure-lsp for advanced IDE features
- root patterns:
deps.edn,project.clj,build.boot,shadow-cljs.edn
clojure-eval-defun- Evaluate top-level formclojure-eval-last-sexp- Evaluate expression before pointclojure-eval-region- Evaluate selected regionclojure-eval-buffer- Evaluate entire bufferclojure-load-file- Load current fileclojure-switch-to-repl- Switch to REPL bufferclojure-set-namespace- Change namespacetoggle-clojure-paren-coloring- Toggle rainbow parentheses
C-c C-c clojure-eval-defun
C-x C-e clojure-eval-last-sexp
C-c C-e clojure-eval-last-sexp
C-c C-r clojure-eval-region
C-c C-k clojure-load-file
C-c C-l clojure-load-file
C-c C-z clojure-switch-to-repl
C-c M-n clojure-set-namespace-from-buffer
clojure-macroexpand-1(C-c Return) - Single-step expansionclojure-macroexpand-all(C-c M-m) - Full expansion- Popup buffer with syntax highlighting
clojure-describe-symbol- Show docstringclojure-describe-symbol-at-point(C-c C-d d) - Doc at point- Popup buffer for documentation display
clojure-inspector-modewith navigationclojure-inspect- Inspect arbitrary expressionclojure-inspect-last-sexp(C-c I) - Inspect sexp- History navigation (l/Backspace to go back)
- Refresh capability (g)
clojure-run-test-at-point(C-c C-t t) - Run test under cursorclojure-run-tests(C-c C-t n) - Run tests in namespaceclojure-run-all-tests(C-c C-t a) - Run all testsclojure-rerun-last-test(C-c C-t l) - Rerun last test- Color-coded pass/fail/error display
- Navigation between failures (n/p)
clojure-stacktrace-modewith keybindingsclojure-show-last-exception(C-c C-x)- Clickable stack frames to jump to source
- Toggle Java frames visibility (j)
- Frame navigation (n/p/Tab)
- Regex patterns for all definition types:
- Functions:
defn,defn-,defmulti,defmethod - Macros:
defmacro - Types:
defprotocol,defrecord,deftype,definterface - Variables:
def,defonce - Namespaces:
ns - Tests:
deftest,defspec
- Functions:
- Auto-setup via mode hook
- Context menu with evaluation actions
- Items: Evaluate Expression, Evaluate Defun, Inspect Value, Run Test, Show Documentation
- Auto-setup via mode hook
- File type registration for
.cljs,.cljc,.cljx,.edn - Shadow-cljs integration (future enhancement)
- Figwheel support (future enhancement)
clojure-align-let(C-c C-a l) - Align let bindingsclojure-align-map(C-c C-a m) - Align map literalsclojure-cycle-privacy(C-c C-p) - Toggle defn/defn-clojure-add-require(C-c C-a r) - Add require clauseclojure-toggle-keyword-string(C-c C-’) - Toggle :keyword/“string”clojure-thread-first- Convert to -> form
- clojure-lsp configuration
- Project detection via
deps.edn,project.clj,build.boot,shadow-cljs.edn - Installation instructions
- TextMate-style language definition
- Special forms (40+)
- Built-in functions (100+)
- Keywords, strings, regex literals
- Numeric literals (decimal, hex, ratios)
- Character literals
- Metadata and deref
clojure-beginning-of-defun/clojure-end-of-defunclojure-indent-sexp(C-M-q)
The original PR comes with a full test suite.
It was done with the help of Claude Code.