2015-12-02 14:23:39 +00:00
#+TITLE : Clojure layer
2015-06-10 16:44:30 +00:00
2019-05-07 08:21:07 +00:00
#+TAGS : dsl|layer|lisp|programming
2019-05-05 17:26:40 +00:00
2015-06-10 16:44:30 +00:00
[[file:img/clojure.png ]] [[file:img/cider.png ]]
2019-05-07 20:05:06 +00:00
* Table of Contents :TOC_5_gh:noexport:
2017-01-18 11:27:08 +00:00
- [[#description ][Description ]]
2017-08-06 02:14:10 +00:00
- [[#features ][Features: ]]
2017-01-18 11:27:08 +00:00
- [[#install ][Install ]]
- [[#layer ][Layer ]]
- [[#pretty-symbols ][Pretty Symbols ]]
2018-10-04 08:58:13 +00:00
- [[#enabling-sayid-or-clj-refactor ][Enabling sayid or clj-refactor ]]
- [[#starting-clojure-manually-outside-of-emacs ][Starting Clojure manually (outside of Emacs) ]]
2017-01-18 11:27:08 +00:00
- [[#quick-start-with-boot ][Quick Start with boot ]]
- [[#quick-start-with-lein ][Quick Start with lein ]]
- [[#more-details ][More details ]]
2017-12-18 00:51:13 +00:00
- [[#usage ][Usage ]]
- [[#cheatsheet ][Cheatsheet ]]
2019-01-14 08:19:14 +00:00
- [[#linting ][Linting ]]
2018-01-04 06:34:23 +00:00
- [[#structuraly-safe-editing ][Structuraly safe editing ]]
2018-12-05 03:03:03 +00:00
- [[#key-bindings ][Key bindings ]]
2017-01-18 11:27:08 +00:00
- [[#working-with-clojure-files-barfage-slurpage--more ][Working with clojure files (barfage, slurpage & more) ]]
- [[#leader ][Leader ]]
- [[#documentation ][Documentation ]]
- [[#evaluation ][Evaluation ]]
- [[#goto ][Goto ]]
- [[#repl ][REPL ]]
- [[#tests ][Tests ]]
- [[#toggles ][Toggles ]]
- [[#debugging ][Debugging ]]
- [[#refactoring ][Refactoring ]]
- [[#reformatting ][Reformatting ]]
2018-02-25 17:44:25 +00:00
- [[#profiling ][Profiling ]]
2017-01-18 11:27:08 +00:00
- [[#cider-buffers ][CIDER Buffers ]]
2018-02-25 17:44:25 +00:00
- [[#cider-repl-mode ][cider-repl-mode ]]
2017-01-18 11:27:08 +00:00
- [[#stacktrace-mode ][stacktrace-mode ]]
- [[#inspector-mode ][inspector-mode ]]
- [[#test-report-mode ][test-report-mode ]]
- [[#sayid-buffers ][Sayid Buffers ]]
- [[#sayid-mode ][sayid-mode ]]
- [[#sayid-traced-mode ][sayid-traced-mode ]]
- [[#sayid-pprint ][sayid-pprint ]]
- [[#development-notes ][Development Notes ]]
- [[#indentation ][Indentation ]]
2015-06-10 16:44:30 +00:00
* Description
2017-04-26 13:50:19 +00:00
This layer adds support for [[https://clojure.org/ ][Clojure ]] language using [[https://github.com/clojure-emacs/cider ][CIDER ]].
2015-06-10 16:44:30 +00:00
2017-08-06 02:14:10 +00:00
** Features:
2015-08-16 09:12:37 +00:00
- REPL via [[https://github.com/clojure-emacs/cider ][CIDER ]]
2016-04-13 03:31:38 +00:00
- Code formatting via [[https://github.com/clojure-emacs/cider ][CIDER ]] using [[https://github.com/weavejester/cljfmt ][Cljfmt ]]
2015-06-10 16:44:30 +00:00
- Refactoring via [[https://github.com/clojure-emacs/clj-refactor.el ][clj-refactor ]]
2019-01-14 08:19:14 +00:00
- Linting via [[https://github.com/clojure-emacs/squiggly-clojure ][squiggly-clojure ]]
2016-01-28 21:30:47 +00:00
- Aligning of code forms via [[https://github.com/clojure-emacs/clojure-mode ][clojure-mode ]]
2018-10-13 20:51:45 +00:00
- Debugging with [[https://github.com/clojure-emacs/sayid ][sayid ]]
2017-12-18 00:51:13 +00:00
- Clojure cheatsheet
2018-01-04 06:34:23 +00:00
- Structuraly safe editing using optional [[https://github.com/luxbock/evil-cleverparens ][evil-cleverparens ]]
2016-04-13 03:31:38 +00:00
2015-06-10 16:44:30 +00:00
* Install
** Layer
2016-01-06 05:21:55 +00:00
To use this configuration layer, add it to your =~/.spacemacs= . You will need to
add =clojure= to the existing =dotspacemacs-configuration-layers= list in this
file.
2015-06-10 16:44:30 +00:00
** Pretty Symbols
2015-06-10 21:16:01 +00:00
Pretty symbols for anonymous functions, set literals and partial, like =(λ [a]
(+ a 5))=, =ƒ(+ % 5)=, = ∈{2 4 6}= and =Ƥ= .
2015-06-10 16:44:30 +00:00
2015-09-28 06:05:18 +00:00
To enable this feature, add the following snippet to the
=dotspacemacs/user-config= section of your =~/.spacemacs= file:
2015-06-10 16:44:30 +00:00
#+BEGIN_SRC emacs-lisp
(setq clojure-enable-fancify-symbols t)
#+END_SRC
Or set this variable when loading the configuration layer:
2018-07-10 10:57:25 +00:00
2015-06-10 16:44:30 +00:00
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((clojure :variables clojure-enable-fancify-symbols t)))
#+END_SRC
2018-10-04 08:58:13 +00:00
** Enabling sayid or clj-refactor
The packages sayid (Clojure debugger) and clj-refactor (automatic refactorings)
2019-06-12 23:27:48 +00:00
are disabled by default. To enable them, add a =:variables= option when enabling
the =clojure= layer, specifying =clojure-enable-sayid= , or
=clojure-enable-clj-refactor= , or both.
2018-10-04 08:58:13 +00:00
In your Spacemacs configuration:
#+BEGIN_SRC emacs-lisp
;; before
dotspacemacs-configuration-layers
'(...
clojure
)
;; after
dotspacemacs-configuration-layers
'(...
(clojure :variables
clojure-enable-sayid t
clojure-enable-clj-refactor t)
)
#+END_SRC
Enabling either of these packages will cause extra nREPL middleware to be
injected when jacking in CIDER.
** Starting Clojure manually (outside of Emacs)
CIDER communicates with your Clojure process through nREPL, and for CIDER to
function correctly extra nREPL middleware needs to be present
(cider/cider-nrepl). The same is true for clj-refactor (refactor-nrepl), and for
sayid (com.billpiel/sayid).
2019-06-12 23:27:48 +00:00
When starting the Clojure process through cider (=cider-jack-in= and friends)
2018-10-04 08:58:13 +00:00
this will be handled automatically, and so most users should be able to just run
~SPC m s i~ to connect to the CIDER REPL and skip the rest of this section.
If you are running an older version of CIDER (0.10 or older), or if you are
starting the Clojure process yourself outside of Emacs, then you need to make
sure the necessary dependencies are present, and the necessary nREPL middlewares
are enabled.
2016-08-26 11:16:15 +00:00
2015-09-16 04:40:13 +00:00
*** Quick Start with boot
2019-04-04 16:29:54 +00:00
- Install =boot= 2.8.2 or newer (see [[https://github.com/boot-clj/boot#user-content-install ]])
2015-09-16 04:40:13 +00:00
- Create a file =~/.boot/profile.boot= with the following content:
2018-09-19 03:54:47 +00:00
#+BEGIN_SRC clojure
(require 'boot.repl)
2015-09-16 04:40:13 +00:00
2018-09-19 03:54:47 +00:00
(swap! boot.repl/*default-dependencies* conj
;; When running an older version of CIDER (pre 0.18), use the
;; version that best matches M-x cider-version. For versions since
;; 0.18.0 use whatever version is the most recent.
2019-03-21 15:05:14 +00:00
'[cider/cider-nrepl "0.21.1"]
2015-09-16 04:40:13 +00:00
2018-09-19 03:54:47 +00:00
;; Only necessary when using clj-refactor
'[refactor-nrepl "2.4.0"]
2018-10-04 08:58:13 +00:00
2018-09-19 03:54:47 +00:00
;; Only necessary when using sayid
'[com.billpiel/sayid "0.0.17"])
2015-09-16 04:40:13 +00:00
2018-09-19 03:54:47 +00:00
(swap! boot.repl/*default-middleware* conj
'cider.nrepl/cider-middleware
'refactor-nrepl.middleware/wrap-refactor
'com.billpiel.sayid.nrepl-middleware/wrap-sayid)
#+END_SRC
2015-09-16 04:40:13 +00:00
2015-06-10 16:44:30 +00:00
*** Quick Start with lein
2019-03-21 15:05:14 +00:00
- Install =lein= version 2.9.0 or newer (see [[https://leiningen.org/#install ]])
2015-06-10 16:44:30 +00:00
- Create a file =~/.lein/profiles.clj= with the following content:
2016-04-13 03:31:38 +00:00
2018-09-19 03:54:47 +00:00
#+BEGIN_SRC clojure
{:repl
{:plugins [;; When running an older version of CIDER (pre 0.18), use the
;; version that best matches M-x cider-version. For versions since
;; 0.18.0 use whatever version is the most recent.
2019-03-21 15:05:14 +00:00
[cider/cider-nrepl "0.21.1"]
2015-06-10 16:44:30 +00:00
2018-09-19 03:54:47 +00:00
;; Only necessary when using clj-refactor
[refactor-nrepl "2.4.0"]
2018-10-04 08:58:13 +00:00
2018-09-19 03:54:47 +00:00
;; Only necessary when using sayid
[com.billpiel/sayid "0.0.17"]]
2018-10-04 08:58:13 +00:00
2018-09-19 03:54:47 +00:00
:dependencies [[nrepl "0.4.5" ]]
2018-10-04 08:58:13 +00:00
2018-09-19 03:54:47 +00:00
:repl-options
2019-05-27 07:31:33 +00:00
{:nrepl-middleware [refactor-nrepl.middleware/wrap-refactor ;; clj-refactor
2018-09-19 03:54:47 +00:00
com.billpiel.sayid.nrepl-middleware/wrap-sayid ;; sayid
]}}}
#+END_SRC
2015-09-05 11:32:11 +00:00
2015-06-10 16:44:30 +00:00
*** More details
More info regarding installation of nREPL middleware can be found here:
2018-10-04 08:58:13 +00:00
- CIDER: [[https://cider.readthedocs.io/en/latest/installation/ ][CIDER installation (official docs) ]]
2015-06-10 16:44:30 +00:00
- clj-refactor: [[https://github.com/clojure-emacs/refactor-nrepl ][refactor-nrepl ]]
2016-04-13 03:31:38 +00:00
2017-12-18 00:51:13 +00:00
* Usage
** Cheatsheet
2018-01-31 16:54:25 +00:00
This layers installs the [[https://github.com/clojure-emacs/clojure-cheatsheet ][clojure-cheatsheet ]] package which embeds this useful
2017-12-18 00:51:13 +00:00
[[https://clojure.org/api/cheatsheet ][cheatsheet ]] into Emacs.
Type ~SPC m h c~ to display the cheatsheet then type in some terms (space
separated) to narrow down the list. For example, try typing in sort map to see
some functions that deal with sorting maps.
2019-01-14 08:19:14 +00:00
** Linting
Linting works via flycheck and disabled by default.
You can enable it like this:
#+BEGIN_SRC emacs-lisp
(setq clojure-enable-linters t)
#+END_SRC
Make sure to read the [[https://github.com/clojure-emacs/squiggly-clojure#warnings ][warnings section ]].
If you have a problem peek into [[https://github.com/clojure-emacs/squiggly-clojure#debugging-and-bug-reporting ][debugging and bug reporting ]] then try to reproduce in the [[https://github.com/clojure-emacs/squiggly-clojure/tree/master/sample-project ][sample project ]].
NOTE: With the default linter configs you should add =org.clojure/core.typed= to the development dependencies.
2018-01-04 06:34:23 +00:00
** Structuraly safe editing
2018-01-04 06:55:54 +00:00
This layer adds support for =evil-cleverparens= which allows to safely edit
2018-01-04 06:34:23 +00:00
lisp code by keeping the s-expressions balanced.
2018-01-04 06:55:54 +00:00
By default this mode is not activated. You can turn it on locally on the active
buffer with ~SPC m T s~ (=s= for safe).
2018-01-04 06:34:23 +00:00
To turn it on automatically for all =clojure= buffers call the following
function in your =dotspacemacs/user-config= function:
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hook-clojure-mode)
2018-01-04 06:34:23 +00:00
#+END_SRC
or to enable it for all supported modes:
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hooks)
2018-01-04 06:34:23 +00:00
#+END_SRC
When enabled the symbol =🆂= should be displayed in the mode-line.
2018-12-05 03:03:03 +00:00
* Key bindings
2015-10-08 09:53:03 +00:00
** Working with clojure files (barfage, slurpage & more)
2016-11-22 20:53:50 +00:00
Spacemacs comes with a special =lisp-state= for working with lisp code that
2019-05-26 20:58:52 +00:00
supports slurpage, barfage and more tools you'll likely want when working with
2015-10-09 10:15:35 +00:00
lisp.
2015-10-08 09:53:03 +00:00
2015-10-09 10:15:35 +00:00
As this state works the same for all files, the documentation is in global
[[https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#lisp-key-bindings ][DOCUMENTATION.org ]]. In general, use ~SPC k~ to interact with the lisp-state.
2015-06-10 16:44:30 +00:00
2015-08-16 09:12:37 +00:00
** Leader
*** Documentation
2015-06-10 16:44:30 +00:00
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2018-06-13 16:00:17 +00:00
|-------------+-----------------------------|
| ~SPC m h a~ | cider apropos |
| ~SPC m h c~ | clojure cheatsheet |
| ~SPC m h g~ | cider grimoire |
| ~SPC m h h~ | cider doc |
| ~SPC m h j~ | cider javadoc |
| ~SPC m h n~ | cider browse namespace |
| ~SPC m h N~ | cider browse all namespaces |
2015-06-10 16:44:30 +00:00
2015-08-16 09:12:37 +00:00
*** Evaluation
2015-06-10 16:44:30 +00:00
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2017-06-20 21:53:01 +00:00
|-------------+-----------------------------------------------------------|
| ~SPC m e ;~ | eval sexp and show result as comment |
| ~SPC m e b~ | eval buffer |
| ~SPC m e e~ | eval last sexp |
| ~SPC m e f~ | eval function at point |
2019-06-12 14:55:01 +00:00
| ~SPC m e i~ | interrupt the current evaluation |
2017-06-20 21:53:01 +00:00
| ~SPC m e r~ | eval region |
| ~SPC m e m~ | cider macroexpand 1 |
| ~SPC m e M~ | cider macroexpand all |
| ~SPC m e p~ | print last sexp (clojure interaction mode only) |
| ~SPC m e P~ | eval last sexp and pretty print result in separate buffer |
2019-04-19 19:59:51 +00:00
| ~SPC m e u~ | Undefine a symbol from the current namespace |
2019-07-03 22:06:11 +00:00
| ~SPC m e v~ | eval sexp around point |
2017-06-20 21:53:01 +00:00
| ~SPC m e w~ | eval last sexp and replace with result |
2015-06-10 16:44:30 +00:00
2015-08-16 09:12:37 +00:00
*** Goto
2015-06-10 16:44:30 +00:00
2019-07-12 12:38:34 +00:00
| Key binding | Description |
|-------------+----------------------------------------------|
| ~SPC m g b~ | go back |
| ~SPC m g C~ | browse classpath |
| ~SPC m g g~ | goto var definition =spacemacs/clj-find-var= |
| ~SPC m g e~ | goto error |
| ~SPC m g n~ | goto namespace |
| ~SPC m g r~ | goto resource |
| ~SPC m g s~ | browse spec |
| ~SPC m g S~ | browse all specs |
2015-06-10 16:44:30 +00:00
2015-08-16 09:12:37 +00:00
*** REPL
2019-07-11 14:01:40 +00:00
| Key binding | Description |
|---------------+--------------------------------------------------------------------------------|
| ~SPC m ,~ | handle shortcut (cider-repl-handle-shortcut) |
| ~SPC m s b~ | send and eval buffer in REPL |
| ~SPC m s B~ | send and eval buffer and switch to REPL in =insert state= |
| ~SPC m s c~ | connect to REPL (cider-connect) or clear repl buffer (cider-repl-clear-buffer) |
| ~SPC m s C~ | clear REPL (cider-find-and-clear-repl-output) |
| ~SPC m s e~ | send and eval last sexp in REPL |
| ~SPC m s E~ | send and eval last sexp and switch to REPL in =insert state= |
| ~SPC m s f~ | send and eval function in REPL |
| ~SPC m s F~ | send and eval function and switch to REPL in =insert state= |
| ~SPC m s j c~ | start Clojure REPL (=cider-jack-in-clj=) |
| ~SPC m s j f~ | start Clojure REPL (=cider-jack-in-clj&cljs=) |
| ~SPC m s j s~ | start ClojureScript REPL (=cider-jack-in-cljs=) |
| ~SPC m s n~ | send and eval ns form in REPL |
| ~SPC m s N~ | send and eval ns form and switch to REPL in =insert state= |
| ~SPC m s q~ | kill REPL (cider-quit) |
| ~SPC m s o~ | switch to other repl instance (cider-repl-switch-to-other) |
| ~SPC m s r~ | send and eval region in REPL |
| ~SPC m s R~ | send and eval region and switch to REPL in =insert state= |
| ~SPC m s s~ | switch to REPL or jump to last file or last clj buffer from repl (cider-repl) |
| ~SPC m s u~ | require Clojure utils into current namespace - i.e. functions =doc= =source= |
| ~SPC m s x~ | refresh REPL |
| ~SPC m s X~ | restart REPL |
2015-08-16 09:12:37 +00:00
*** Tests
2015-06-10 16:44:30 +00:00
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2015-06-10 16:44:30 +00:00
|-------------+------------------------------------|
| ~SPC m t a~ | run all tests in namespace |
| ~SPC m t r~ | re-run test failures for namespace |
| ~SPC m t t~ | run test at point |
2015-09-04 17:11:04 +00:00
*** Toggles
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2015-09-04 17:11:04 +00:00
|-------------+-----------------------------|
2016-08-17 19:50:24 +00:00
| ~SPC m T e~ | toggle englighten mode |
2015-10-09 10:15:35 +00:00
| ~SPC m T f~ | toggle REPL font-locking |
| ~SPC m T i~ | toggle indentation style |
2018-02-24 15:40:06 +00:00
| ~SPC m T p~ | toggle REPL pretty-printing |
2016-08-17 19:50:24 +00:00
| ~SPC m T t~ | toggle auto test mode |
2015-09-04 17:11:04 +00:00
2015-08-16 09:12:37 +00:00
*** Debugging
2015-06-21 02:42:44 +00:00
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2017-01-18 11:27:08 +00:00
|---------------+----------------------------------------------------|
2018-02-24 15:40:06 +00:00
| ~SPC m d !~ | reload traces and clear sayid workspace |
2017-01-18 11:27:08 +00:00
| ~SPC m d b~ | instrument expression at point |
2018-02-24 15:40:06 +00:00
| ~SPC m d c~ | clear workspace trace log |
2017-01-18 11:27:08 +00:00
| ~SPC m d e~ | display last stacktrace |
| ~SPC m d E~ | one time display of value at cursor |
2018-02-24 15:40:06 +00:00
| ~SPC m d f~ | query form at point |
2018-10-23 14:18:21 +00:00
| ~SPC m d h~ | show sayid help (key bindings may not be accurate) |
2018-02-24 15:40:06 +00:00
| ~SPC m d i~ | inspect expression at point |
| ~SPC m d r~ | reload namespaces |
2017-01-18 11:27:08 +00:00
| ~SPC m d s~ | show what is currently traced |
| ~SPC m d S~ | show what is currently traced in current namespace |
2019-05-26 20:58:52 +00:00
| ~SPC m d t b~ | trace current file's namespace |
2017-01-18 11:27:08 +00:00
| ~SPC m d t d~ | disable existing trace on current function |
| ~SPC m d t D~ | disable existing trace on all functions |
2018-02-24 15:40:06 +00:00
| ~SPC m d t e~ | enable existing trace on current function |
| ~SPC m d t E~ | enable existing trace on all functions |
| ~SPC m d t K~ | remove all traces |
2017-01-18 11:27:08 +00:00
| ~SPC m d t n~ | create inner trace on function |
| ~SPC m d t o~ | create outer trace on function |
2018-02-24 15:40:06 +00:00
| ~SPC m d t p~ | trace namespaces by regex |
2017-01-18 11:27:08 +00:00
| ~SPC m d t r~ | remove trace on function |
2018-02-24 15:40:06 +00:00
| ~SPC m d t y~ | recursively trace every namespace in given dir |
| ~SPC m d v~ | inspect expression at point |
| ~SPC m d V~ | set the view |
| ~SPC m d w~ | open sayid workspace window |
| ~SPC m d x~ | clear workspace traces and log |
2015-06-21 02:42:44 +00:00
2015-08-16 09:12:37 +00:00
*** Refactoring
2018-11-01 12:10:13 +00:00
The following refactoring key bindings are enabled by default in clojure-mode:
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2018-11-01 12:10:13 +00:00
|---------------+----------------------------------------------------------------|
| ~SPC m r c i~ | cycle between if and if-not forms |
| ~SPC m r c p~ | cycle privacy of defn and def forms |
| ~SPC m r c (~ | convert coll to list |
| ~SPC m r c '~ | convert coll to quoted list |
| ~SPC m r c {~ | convert coll to map |
| ~SPC m r c #~ | convert coll to set |
| ~SPC m r c [~ | convert coll to vector |
| ~SPC m r t f~ | rewrite the following form to use the -> (thread first) macro. |
| ~SPC m r t l~ | rewrite the following form to use the ->> (thread last) macro. |
| ~SPC m r t h~ | thread another form into the surrounding threading macro |
| ~SPC m r u a~ | unwind all steps of surrounding threading macro |
| ~SPC m r u w~ | unwind threading macro one step at a time |
The following refactorings require cljr-refactor to be enabled and generally depend on a connected CIDER session.
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2017-07-13 16:09:41 +00:00
|---------------+-----------------------------------|
| ~SPC m r ?~ | describe refactoring |
| ~SPC m r a d~ | add declaration |
| ~SPC m r a i~ | add import to ns |
| ~SPC m r a m~ | add missing libspec |
| ~SPC m r a p~ | add project dependency |
| ~SPC m r a r~ | add require to ns |
| ~SPC m r a u~ | add use to ns |
| ~SPC m r c :~ | toggle between keyword and string |
| ~SPC m r c n~ | clean ns |
| ~SPC m r d k~ | destructure keys |
| ~SPC m r e c~ | extract constant |
| ~SPC m r e d~ | extract definition |
| ~SPC m r e f~ | extract function |
| ~SPC m r e l~ | expand let |
| ~SPC m r f u~ | find usages |
| ~SPC m r f e~ | create fn from example |
| ~SPC m r h d~ | hotload dependency |
| ~SPC m r i l~ | introduce let |
| ~SPC m r i s~ | inline symbol |
| ~SPC m r m f~ | move form |
| ~SPC m r m l~ | move to let |
| ~SPC m r p c~ | project clean |
| ~SPC m r p f~ | promote function |
| ~SPC m r r d~ | remove debug fns |
| ~SPC m r r f~ | rename file |
| ~SPC m r r l~ | remove let |
| ~SPC m r r r~ | remove unused requires |
| ~SPC m r r s~ | rename symbol |
| ~SPC m r r u~ | replace use |
| ~SPC m r s n~ | sort ns |
| ~SPC m r s p~ | sort project dependencies |
| ~SPC m r s r~ | stop referring |
| ~SPC m r s c~ | show changelog |
| ~SPC m r u p~ | update project dependencies |
2015-08-16 09:12:37 +00:00
*** Reformatting
2016-04-13 03:31:38 +00:00
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2018-10-23 14:18:21 +00:00
|--------------------------+-------------------------|
| ~SPC m f b~ or ~SPC m =~ | reformat current buffer |
| ~SPC m f l~ | realign current form |
| | |
2018-02-25 17:44:25 +00:00
*** Profiling
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2018-02-25 17:44:25 +00:00
|-------------+----------------------|
| ~SPC m p +~ | profile samples |
| ~SPC m p c~ | clear profile |
| ~SPC m p n~ | toggle profile ns |
| ~SPC m p s~ | profile summary |
| ~SPC m p S~ | summary for all |
| ~SPC m p t~ | toggle profile |
| ~SPC m p v~ | is variable profiled |
2015-08-16 09:12:37 +00:00
** CIDER Buffers
In general, ~q~ should always quit the popped up buffer.
2018-02-25 17:44:25 +00:00
*** cider-repl-mode
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2018-02-25 17:44:25 +00:00
|-------------+----------------|
| ~C-j~ | next input |
| ~C-k~ | previous input |
2015-08-16 09:12:37 +00:00
*** stacktrace-mode
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2015-08-16 09:12:37 +00:00
|-------------+---------------------|
2015-08-25 01:07:59 +00:00
| ~C-j~ | next cause |
| ~C-k~ | previous cause |
| ~TAB~ | cycle current cause |
| ~0~ | cycle all causes |
| ~1~ | cycle cause 1 |
| ~2~ | cycle cause 2 |
| ~3~ | cycle cause 3 |
| ~4~ | cycle cause 4 |
| ~5~ | cycle cause 5 |
| ~a~ | toggle all |
| ~c~ | toggle clj |
| ~d~ | toggle duplicates |
| ~J~ | toggle java |
| ~r~ | toggle repl |
| ~T~ | toggle tooling |
2015-08-16 09:12:37 +00:00
*** inspector-mode
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2015-08-16 09:12:37 +00:00
|-------------+---------------------------------|
2015-08-25 01:07:59 +00:00
| ~TAB~ | next inspectable object |
| ~Shift-TAB~ | previous inspectable object |
| ~RET~ | inspect object |
| ~L~ | pop to the parent object |
| ~n~ | next page in paginated view |
| ~N~ | previous page in paginated view |
| ~r~ | refresh |
| ~s~ | set a new page size |
2015-08-16 09:12:37 +00:00
*** test-report-mode
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2017-01-23 11:25:48 +00:00
|-------------+--------------------|
| ~C-j~ | next result |
| ~C-k~ | previous result |
| ~RET~ | jump to test |
| ~d~ | ediff test result |
| ~e~ | show stacktrace |
| ~r~ | rerun failed tests |
| ~t~ | run test |
| ~T~ | run tests |
2015-08-16 09:12:37 +00:00
2017-01-18 11:27:08 +00:00
** Sayid Buffers
*** sayid-mode
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2017-01-18 11:27:08 +00:00
|--------------------+---------------------------------------------------|
2018-02-24 15:40:06 +00:00
| ~Shift-Backspace~ | forward buffer state |
2017-01-18 11:27:08 +00:00
| ~enter~ | pop to function |
| ~d~ | def value to $s/* |
| ~f~ | query for calls to function |
| ~F~ | query to calls to function with modifier |
| ~i~ | show only this instance |
| ~I~ | show only this instance with modifier |
2018-02-24 15:40:06 +00:00
| ~L~ or ~Backspace~ | previous buffer state |
2017-01-18 11:27:08 +00:00
| ~n~ | jump to next call |
| ~N~ | jump to previous call |
| ~P~ | pretty print value |
| ~C~ | clear workspace trace log |
| ~e~ | generate instance expression and put in kill ring |
2018-10-23 14:18:21 +00:00
| ~H~ | display help (key bindings may not be accurate) |
2018-02-24 15:40:06 +00:00
| ~w~ | show full workspace trace |
2017-01-18 11:27:08 +00:00
| ~C-s v~ | toggle view |
| ~C-s V~ | set view |
*** sayid-traced-mode
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2018-10-23 14:18:21 +00:00
|-------------+-------------------------------------------------|
| ~backspace~ | go back to trace overview |
| ~enter~ | drill into ns at point |
| ~e~ | enable trace |
| ~E~ | enable all traces |
| ~d~ | disable trace |
| ~D~ | disable all traces |
| ~h~ | display help (key bindings may not be accurate) |
| ~i~ | apply inner trace to function at point |
| ~o~ | apply outer trace to function at point |
| ~r~ | remove trace at point |
2017-01-18 11:27:08 +00:00
*** sayid-pprint
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2017-01-18 11:27:08 +00:00
|-------------+-----------------------------|
| ~enter~ | show path in minibuffer |
| ~i~ | enter child node |
| ~o~ | enter parent node |
| ~n~ | enter next sibling node |
| ~p~ | enter previous sibling node |
2016-01-18 18:30:27 +00:00
* Development Notes
** Indentation
2019-07-08 20:53:07 +00:00
With a [[https://github.com/clojure-emacs/cider/blob/master/legacy-manual/indent_spec.md ][new ]] functionality of Cider to read the custom indentation rules from the
2019-05-26 20:58:52 +00:00
var's metadata, it is better for consistency reasons to not add the custom
2016-01-18 18:30:27 +00:00
indentation rules to Spacemacs, but to add them to the metadata of those
specific vars.