diff --git a/modules/lang/clojure/README.org b/modules/lang/clojure/README.org index e7da08a3d..453fc904c 100644 --- a/modules/lang/clojure/README.org +++ b/modules/lang/clojure/README.org @@ -10,11 +10,11 @@ This module adds support for the Clojure(Script) language. running tests, definitions & documentation lookup, code completion, and much more - Refactoring (~clj-refactor~) -- Linting (~clj-kondo~), requires ~:checkers syntax~ -- LSP support (~clojure-lsp~) +- Linting (~clj-kondo~), requires [[doom-module::checkers syntax]] +- LSP support (~clojure-lsp~), required [[doom-module:+lsp]] ** Maintainers -/This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]] +- [[doom-user:][@elken]] ** Module flags - +lsp :: @@ -43,68 +43,108 @@ This module adds support for the Clojure(Script) language. This module requires: - [[https://clojure.org/][clojure]] -- [[https://leiningen.org/][leiningen]], for the REPL -- [[https://github.com/borkdude/clj-kondo][clj-kondo]], for linting code +- [[https://github.com/borkdude/clj-kondo][clj-kondo]], for linting code (if [[doom-module::checkers syntax]]) - [[https://clojure-lsp.github.io/clojure-lsp/][clojure-lsp]], for LSP support (if [[doom-module:+lsp]]) +- [[https://github.com/babashka/neil][neil]] for the ability to add packages to your Clojure project from Emacs +- [[https://github.com/borkdude/jet][jet]] for jet integration -* TODO Usage -#+begin_quote - 🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] -#+end_quote +* Usage -| Keybind | Command | -|-------------------+------------------------------------------------------| +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 | +|-----------------------------+----------------------------------------------------| | [[kbd:][ ']] | ~cider-jack-in-clj~ | -| [[kbd:][ C]] | ~cider-connect-cljs~ | -| [[kbd:][ M]] | ~cider-macroexpand-all~ | -| [[kbd:][ R]] | ~hydra-cljr-help-menu/body~ | | [[kbd:][ c]] | ~cider-connect-clj~ | -| [[kbd:][ e D]] | ~cider-insert-defun-in-repl~ | -| [[kbd:][ e E]] | ~cider-insert-last-sexp-in-repl~ | -| [[kbd:][ e R]] | ~cider-insert-region-in-repl~ | -| [[kbd:][ e b]] | ~cider-eval-buffer~ | -| [[kbd:][ e d]] | ~cider-eval-defun-at-point~ | -| [[kbd:][ e e]] | ~cider-eval-last-sexp~ | -| [[kbd:][ e r]] | ~cider-eval-region~ | -| [[kbd:][ e u]] | ~cider-undef~ | -| [[kbd:][ g b]] | ~cider-pop-back~ | -| [[kbd:][ g g]] | ~cider-find-var~ | -| [[kbd:][ g n]] | ~cider-find-ns~ | -| [[kbd:][ h a]] | ~cider-apropos~ | -| [[kbd:][ h c]] | ~cider-clojuredocs~ | -| [[kbd:][ h d]] | ~cider-doc~ | -| [[kbd:][ h j]] | ~cider-javadoc~ | -| [[kbd:][ h n]] | ~cider-find-ns~ | -| [[kbd:][ h w]] | ~cider-clojuredocs-web~ | -| [[kbd:][ i e]] | ~cider-enlighten-mode~ | -| [[kbd:][ i i]] | ~cider-inspect~ | -| [[kbd:][ i r]] | ~cider-inspect-last-result~ | +| [[kbd:][ C]] | ~cider-connect-cljs~ | | [[kbd:][ m "]] | ~cider-jack-in-cljs~ | -| [[kbd:][ m]] | ~cider-macroexpand-1~ | -| [[kbd:][ n N]] | ~cider-browse-ns-all~ | -| [[kbd:][ n n]] | ~cider-browse-ns~ | -| [[kbd:][ n r]] | ~cider-ns-refresh~ | -| [[kbd:][ p d]] | ~cider-pprint-eval-defun-at-point~ | -| [[kbd:][ p D]] | ~cider-pprint-eval-defun-to-comment~ | -| [[kbd:][ p p]] | ~cider-pprint-eval-last-sexp~ | -| [[kbd:][ p P]] | ~cider-pprint-eval-last-sexp-to-comment~ | -| [[kbd:][ p r]] | ~cider-pprint-eval-last-sexp-to-repl~ | +| [[kbd:][ r R]] | ~cider-restart~ | +| [[kbd:][ r q]] | ~cider-quit~ | | [[kbd:][ r B]] | ~+clojure/cider-switch-to-repl-buffer-and-switch-ns~ | | [[kbd:][ r L]] | ~cider-load-buffer-and-switch-to-repl-buffer~ | -| [[kbd:][ r R]] | ~cider-restart~ | | [[kbd:][ r b]] | ~cider-switch-to-repl-buffer~ | | [[kbd:][ r c]] | ~cider-find-and-clear-repl-output~ | | [[kbd:][ r l]] | ~cider-load-buffer~ | | [[kbd:][ r n]] | ~cider-repl-set-ns~ | -| [[kbd:][ r q]] | ~cider-quit~ | | [[kbd:][ r r]] | ~cider-ns-refresh~ | -| [[kbd:][ t a]] | ~cider-test-rerun-test~ | -| [[kbd:][ t l]] | ~cider-test-run-loaded-tests~ | -| [[kbd:][ t n]] | ~cider-test-run-ns-tests~ | -| [[kbd:][ t p]] | ~cider-test-run-project-tests~ | -| [[kbd:][ t r]] | ~cider-test-rerun-failed-tests~ | -| [[kbd:][ t s]] | ~cider-test-run-ns-tests-with-filters~ | -| [[kbd:][ t t]] | ~cider-test-run-test~ | + +** Tests +The module also provides support for running tests through cider, including a nicely formatted output. + +| Keybind | Command | +|-----------------------------+--------------------------------------| +| [[kbd:][ t a]] | ~cider-test-rerun-test~ | +| [[kbd:][ t l]] | ~cider-test-run-loaded-tests~ | +| [[kbd:][ t n]] | ~cider-test-run-ns-tests~ | +| [[kbd:][ t p]] | ~cider-test-run-project-tests~ | +| [[kbd:][ t r]] | ~cider-test-rerun-failed-tests~ | +| [[kbd:][ t s]] | ~cider-test-run-ns-tests-with-filters~ | +| [[kbd:][ 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 | +|-----------------------------+---------------------| +| [[kbd:][ g b]] | ~cider-pop-back~ | +| [[kbd:][ g g]] | ~cider-find-var~ | +| [[kbd:][ g n]] | ~cider-find-ns~ | +| [[kbd:][ h n]] | ~cider-find-ns~ | +| [[kbd:][ n N]] | ~cider-browse-ns-all~ | +| [[kbd:][ n n]] | ~cider-browse-ns~ | +| [[kbd:][ h a]] | ~cider-apropos~ | + +** Evaluation +Outside of the [[kbd:][SPC m e]] bindings for evaluating forms, the following are also available; including some to pretty-print the results. + +| Keybind | Command | +|-----------------------------+----------------------------------------| +| [[kbd:][ e D]] | ~cider-insert-defun-in-repl~ | +| [[kbd:][ e E]] | ~cider-insert-last-sexp-in-repl~ | +| [[kbd:][ e R]] | ~cider-insert-region-in-repl~ | +| [[kbd:][ e b]] | ~cider-eval-buffer~ | +| [[kbd:][ e d]] | ~cider-eval-defun-at-point~ | +| [[kbd:][ e e]] | ~cider-eval-last-sexp~ | +| [[kbd:][ e r]] | ~cider-eval-region~ | +| [[kbd:][ p d]] | ~cider-pprint-eval-defun-at-point~ | +| [[kbd:][ p D]] | ~cider-pprint-eval-defun-to-comment~ | +| [[kbd:][ p p]] | ~cider-pprint-eval-last-sexp~ | +| [[kbd:][ p P]] | ~cider-pprint-eval-last-sexp-to-comment~ | +| [[kbd:][ 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 [[https://www.youtube.com/watch?v=tCu2AewBTR4][here]]. + +| Keybind | Command | +|-----------------------------+---------------------------| +| [[kbd:][ M]] | ~cider-macroexpand-all~ | +| [[kbd:][ R]] | ~hydra-cljr-help-menu/body~ | +| [[kbd:][ e u]] | ~cider-undef~ | +| [[kbd:][ i e]] | ~cider-enlighten-mode~ | +| [[kbd:][ i i]] | ~cider-inspect~ | +| [[kbd:][ i r]] | ~cider-inspect-last-result~ | +| [[kbd:][ m]] | ~cider-macroexpand-1~ | + +** Help +Several bindings used for viewing documentation for various functions, both inside and outside of both a REPL and Emacs ([[kbd:][K]] for example uses the sources and a cached version of clojuredocs) + +| Keybind | Command | +|-----------------------------+-----------------------| +| [[kbd:][ h c]] | ~cider-clojuredocs~ | +| [[kbd:][ h d]] | ~cider-doc~ | +| [[kbd:][ h j]] | ~cider-javadoc~ | +| [[kbd:][ h w]] | ~cider-clojuredocs-web~ | +| [[kbd:][K]] | ~+lookup/documentation~ | + * TODO Configuration #+begin_quote