1

Expand CIDER customizations

This commit is contained in:
Jessie Hildebrandt 2023-03-16 11:42:27 -04:00
parent 237ed62ce3
commit 4e78b6f356

41
init.el
View File

@ -932,9 +932,16 @@ DOCSTRING is an optional form that is discarded upon expansion."
;; cider
;; ---------------------------------- ;;
(defun user/abbreviate-ns (namespace)
"Return NAMESPACE with all but the last name abbreviated."
(let* ((abbreviated-ns (cider-abbreviate-ns "some-class.wow.git-mirror-magic.core"))
(defun user/cider-error-buffer ()
"Switch to the CIDER error buffer, if it exists."
(interactive)
(if (get-buffer cider-error-buffer)
(pop-to-buffer cider-error-buffer)
(message "No active CIDER stacktrace buffer.")))
(defun user/prettify-cider-namespace (namespace)
"Return NAMESPACE formatted and with all but the last name abbreviated."
(let* ((abbreviated-ns (cider-abbreviate-ns namespace))
(names (reverse (split-string abbreviated-ns "\\.")))
(last-name (car names)))
(concat (mapconcat (lambda (name)
@ -949,30 +956,26 @@ DOCSTRING is an optional form that is discarded upon expansion."
"Provides an interactive programming environment for Clojure."
:custom
(nrepl-hide-special-buffers t "Hide REPL communications buffers from buffer lists.")
(cider-session-name-template "%j" "Label CIDER sessions with the short name of the current project.")
(cider-reply-display-in-current-window t "Use current window when creating a CIDER REPL buffer.")
(cider-show-error-buffer nil "Disable automatic display of the CIDER stacktrace info buffer.")
(cider-use-fringe-indicators nil "Disable evaluation indicators in the fringe of CIDER buffers.")
(cider-session-name-template "%j" "Label CIDER sessions with the short name of the current project.")
(cider-eval-spinner-type ["" "" "" "" "" ""] "Use an activity spinner that utilizes Fira Code glyphs.")
(cider-eval-spinner-delay 0.5 "Show the evaluation activity spinner after 0.5 seconds of activity.")
(cider-repl-display-help-banner nil "Disable initial infodump in CIDER REPL buffers.")
(cider-repl-prompt-function (lambda (namespace)
(concat (user/abbreviate-ns namespace) "")))
:config
(setq nrepl-repl-buffer-name-template "*CIDER: %s (%r:%S)*"
cider--debug-buffer-format "*CIDER: Debugging %s*"
cider-inspector-buffer "*CIDER: Inspect*"
cider-error-buffer "*CIDER: Error*")
:commands
(cider)
(cider-repl-prompt-function (lambda (namespace) (concat (user/prettify-cider-namespace namespace) "")))
:hook
(clojure-mode-hook . cider-mode)
(cider-repl-mode-hook . electric-pair-local-mode)
:bind
(:map clojure-mode-map
("C-c RET" . nil))
(:map cider-mode-map
("C-c RET" . nil)
("M-." . cider-find-var)
("M-," . cider-pop-back)
("C-c m" . cider-macroexpand-1)
("C-c C-f" . cider-load-file)
("C-c C-b" . cider-load-buffer))
("C-c C-b" . cider-load-buffer)
("C-c C-\\" . cider-format-buffer)
("C-c M-e" . user/cider-error-buffer))
(:map cider-repl-mode-map
("C-c RET" . nil)
("C-c C-e" . end-of-buffer)
("C-<return>" . (lambda ()
(interactive)