Wilfred/helpful@5ad8a9ce57 -> Wilfred/helpful@6a4d5e0760 agda/agda@10a0ca0516 -> agda/agda@49a12eab7f clojure-emacs/cider@a0d6169026 -> clojure-emacs/cider@fdfa7c2200 dominikh/go-mode.el@602d73e226 -> dominikh/go-mode.el@0ed3c5227e emacs-geiser/gauche@8ff743f641 -> emacs-geiser/gauche@9eb8b35f0c emacs-lsp/lsp-dart@7e3d342941 -> emacs-lsp/lsp-dart@2170823139 emacs-lsp/lsp-java@868600bf7f -> emacs-lsp/lsp-java@6cfff8761e emacs-lsp/lsp-metals@567089f7f4 -> emacs-lsp/lsp-metals@345b4fa80e emacs-lsp/lsp-sourcekit@63ff1ab638 -> emacs-lsp/lsp-sourcekit@3bd9750e7e emacs-lsp/lsp-treemacs@fb1a07ae0a -> emacs-lsp/lsp-treemacs@312dee2b3a emacs-rustic/rustic@fbbf0a7192 -> emacs-rustic/rustic@22a5ef8bfd emacs-straight/auctex@53f80ba36c -> emacs-straight/auctex@6fb366064c emacs-straight/csv-mode@6979fc18eb -> emacs-straight/csv-mode@1695ee1752 emacsorphanage/dart-mode@88b6683f43 -> emacsorphanage/dart-mode@6229941ec5 erlang/otp@64185e73b0 -> erlang/otp@740af6bae5 fsharp/emacs-fsharp-mode@677d78c4d6 -> fsharp/emacs-fsharp-mode@bf7a11e1ba gcv/julia-snail@24f79a067b -> gcv/julia-snail@cacf52e4c8 godotengine/emacs-gdscript-mode@c3d9988984 -> godotengine/emacs-gdscript-mode@3f3739dd88 greghendershott/racket-mode@eef5e9ab2c -> greghendershott/racket-mode@88d82e249e jrblevin/markdown-mode@ee9d6de1d2 -> jrblevin/markdown-mode@d2d960bec1 json-emacs/json-mode@77125b01c0 -> json-emacs/json-mode@466d5b5637 ledger/ledger-mode@356d8049ed -> ledger/ledger-mode@d9b6648201 rust-lang/rust-mode@542f1755d8 -> rust-lang/rust-mode@efd830806c seagle0128/grip-mode@ffce7f78eb -> seagle0128/grip-mode@e90e3b47d8 ziglang/zig-mode@f0b4a48753 -> ziglang/zig-mode@4ad4edf759
:lang clojure
Description unfold
This module adds support for the Clojure(Script) language.
- Interactive development environment (
cider
): REPL, compilation, debugging, running tests, definitions & documentation lookup, code completion, and much more - Refactoring (
clj-refactor
) - Linting (
clj-kondo
), requires doom-module::checkers syntax - LSP support (
clojure-lsp
), required doom-module:+lsp
Maintainers
Module flags
- +lsp
-
Enable LSP support for
clojure-mode
(alongside Cider). Requires doom-module::tools lsp and a langserver (supports clojure-lsp). - +tree-sitter
- Leverages tree-sitter for better syntax highlighting and structural text editing. Requires doom-module::tools tree-sitter.
Packages
- doom-package:cider
- doom-package:clj-refactor
- doom-package:flycheck-clj-kondo if doom-module::checkers syntax
Hacks
- Error messages emitted from CIDER are piped into the REPL buffer when it is first opened, to make them easier to notice.
- Disabled the help banner when opening the cider REPL.
TODO Changelog
This module does not have a changelog yet.
Installation
Enable this module in your doom!
block.
This module requires:
This module optionally requires:
- clj-kondo, for linting code (if doom-module::checkers syntax)
- clojure-lsp, for LSP support (if doom-module:+lsp)
- neil for the ability to add packages to your Clojure project from Emacs
- jet for jet integration
- cljfmt, for formatting code (if doom-module::editor format)
Usage
Below is a listing of the various keybinds provided by the module.
REPL management
For the most part, general usage should fall into:
- Open a Clojure project
- Open/connect to a REPL
As such, these bindings are most likely to be used.
Keybind | Command |
---|---|
<localleader> ' | cider-jack-in-clj |
<localleader> c | cider-connect-clj |
<localleader> C | cider-connect-cljs |
<localleader> m " | cider-jack-in-cljs |
<localleader> r R | cider-restart |
<localleader> r q | cider-quit |
<localleader> r B | +clojure/cider-switch-to-repl-buffer-and-switch-ns |
<localleader> r L | cider-load-buffer-and-switch-to-repl-buffer |
<localleader> r b | cider-switch-to-repl-buffer |
<localleader> r c | cider-find-and-clear-repl-output |
<localleader> r l | cider-load-buffer |
<localleader> r n | cider-repl-set-ns |
<localleader> r r | cider-ns-refresh |
Tests
The module also provides support for running tests through cider, including a nicely formatted output.
Keybind | Command |
---|---|
<localleader> t a | cider-test-rerun-test |
<localleader> t l | cider-test-run-loaded-tests |
<localleader> t n | cider-test-run-ns-tests |
<localleader> t p | cider-test-run-project-tests |
<localleader> t r | cider-test-rerun-failed-tests |
<localleader> t s | cider-test-run-ns-tests-with-filters |
<localleader> t t | cider-test-run-test |
Search/navigation
Some useful bindings for navigating around namespaces and symbols. When using doom-module:+lsp, the bindings in doom-module::tools lsp are supported.
Keybind | Command |
---|---|
<localleader> g b | cider-pop-back |
<localleader> g g | cider-find-var |
<localleader> g n | cider-find-ns |
<localleader> h n | cider-find-ns |
<localleader> n N | cider-browse-ns-all |
<localleader> n n | cider-browse-ns |
<localleader> h a | cider-apropos |
Evaluation
Outside of the SPC m e bindings for evaluating forms, the following are also available; including some to pretty-print the results.
Keybind | Command |
---|---|
<localleader> e D | cider-insert-defun-in-repl |
<localleader> e E | cider-insert-last-sexp-in-repl |
<localleader> e R | cider-insert-region-in-repl |
<localleader> e b | cider-eval-buffer |
<localleader> e d | cider-eval-defun-at-point |
<localleader> e e | cider-eval-last-sexp |
<localleader> e r | cider-eval-region |
<localleader> p d | cider-pprint-eval-defun-at-point |
<localleader> p D | cider-pprint-eval-defun-to-comment |
<localleader> p p | cider-pprint-eval-last-sexp |
<localleader> p P | cider-pprint-eval-last-sexp-to-comment |
<localleader> p r | cider-pprint-eval-last-sexp-to-repl |
Debugging
A number of bindings to provide useful overlays that help during debugging. cider-enlighten-mode
is a mode that will highlight the results of a function evaluation, including the locals. See a demo here.
Keybind | Command |
---|---|
<localleader> M | cider-macroexpand-all |
<localleader> R | hydra-cljr-help-menu/body |
<localleader> e u | cider-undef |
<localleader> i e | cider-enlighten-mode |
<localleader> i i | cider-inspect |
<localleader> i r | cider-inspect-last-result |
<localleader> m | cider-macroexpand-1 |
Help
Several bindings used for viewing documentation for various functions, both inside and outside of both a REPL and Emacs (K for example uses the sources and a cached version of clojuredocs)
Keybind | Command |
---|---|
<localleader> h c | cider-clojuredocs |
<localleader> h d | cider-doc |
<localleader> h j | cider-javadoc |
<localleader> h w | cider-clojuredocs-web |
K | +lookup/documentation |
Configuration
enrich-classpath
In recent versions, an option has been introduced that attempts to improve the experience of CIDER by accessing java source & javadocs, though this option is still currently considered beta.
In order to opt into this, add the following to your config.el
(setq cider-enrich-classpath t)
See the docs for more
Troubleshooting
There are no known problems with this module. Report one?
Frequently asked questions
This module has no FAQs yet. Ask one?
TODO Appendix
This module has no appendix yet. Write one?