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 ;; cider
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(defun user/abbreviate-ns (namespace) (defun user/cider-error-buffer ()
"Return NAMESPACE with all but the last name abbreviated." "Switch to the CIDER error buffer, if it exists."
(let* ((abbreviated-ns (cider-abbreviate-ns "some-class.wow.git-mirror-magic.core")) (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 "\\."))) (names (reverse (split-string abbreviated-ns "\\.")))
(last-name (car names))) (last-name (car names)))
(concat (mapconcat (lambda (name) (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." "Provides an interactive programming environment for Clojure."
:custom :custom
(nrepl-hide-special-buffers t "Hide REPL communications buffers from buffer lists.") (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-show-error-buffer nil "Disable automatic display of the CIDER stacktrace info buffer.")
(cider-reply-display-in-current-window t "Use current window when creating a CIDER REPL buffer.")
(cider-use-fringe-indicators nil "Disable evaluation indicators in the fringe of CIDER buffers.") (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-display-help-banner nil "Disable initial infodump in CIDER REPL buffers.")
(cider-repl-prompt-function (lambda (namespace) (cider-repl-prompt-function (lambda (namespace) (concat (user/prettify-cider-namespace 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)
:hook :hook
(clojure-mode-hook . cider-mode) (clojure-mode-hook . cider-mode)
(cider-repl-mode-hook . electric-pair-local-mode)
:bind :bind
(:map clojure-mode-map
("C-c RET" . nil))
(:map cider-mode-map (: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-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 (:map cider-repl-mode-map
("C-c RET" . nil)
("C-c C-e" . end-of-buffer) ("C-c C-e" . end-of-buffer)
("C-<return>" . (lambda () ("C-<return>" . (lambda ()
(interactive) (interactive)