lang/clojure: More changes
- Add a popup rule for the history buffer, since we want to see the REPL change while it's open - Add hooks to enable company fuzzy completion - Add more cider configuration options - Configure Shift-Return to insert a newline and indent in the REPL without submitting the result - Bind normal state keybindings for the CIDER history buffer
This commit is contained in:
parent
5ad27da2f1
commit
bd1f2ec4d6
1 changed files with 32 additions and 8 deletions
|
@ -4,6 +4,11 @@
|
||||||
(after! clojure-mode
|
(after! clojure-mode
|
||||||
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
|
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
|
||||||
|
|
||||||
|
(set-popup-rules!
|
||||||
|
'(("^\\*cider-error*" :ignore t)
|
||||||
|
("^\\*cider-repl" :quit nil :select nil)
|
||||||
|
("^\\*cider-repl-history" :vslot 2 :ttl nil)))
|
||||||
|
|
||||||
(defun +clojure|cider-switch-to-repl-buffer-and-switch-ns ()
|
(defun +clojure|cider-switch-to-repl-buffer-and-switch-ns ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(cider-switch-to-repl-buffer t))
|
(cider-switch-to-repl-buffer t))
|
||||||
|
@ -14,27 +19,46 @@
|
||||||
:commands (cider-jack-in cider-jack-in-clojurescript)
|
:commands (cider-jack-in cider-jack-in-clojurescript)
|
||||||
:hook (clojure-mode . cider-mode)
|
:hook (clojure-mode . cider-mode)
|
||||||
:init
|
:init
|
||||||
(set-popup-rule! "^\\*cider-repl" :quit nil :select nil)
|
|
||||||
(set-repl-handler! 'clojure-mode #'+clojure/repl)
|
(set-repl-handler! 'clojure-mode #'+clojure/repl)
|
||||||
(set-eval-handler! 'clojure-mode #'cider-eval-region)
|
(set-eval-handler! 'clojure-mode #'cider-eval-region)
|
||||||
(set-lookup-handlers! 'clojure-mode
|
(set-lookup-handlers! 'clojure-mode
|
||||||
:definition #'cider-browse-ns-find-at-point
|
:definition #'cider-browse-ns-find-at-point
|
||||||
:documentation #'cider-browse-ns-doc-at-point)
|
:documentation #'cider-browse-ns-doc-at-point)
|
||||||
|
(add-hook 'cider-repl-mode-hook #'cider-company-enable-fuzzy-completion)
|
||||||
|
(add-hook 'cider-mode-hook #'cider-company-enable-fuzzy-completion)
|
||||||
(add-hook 'cider-mode-hook #'eldoc-mode)
|
(add-hook 'cider-mode-hook #'eldoc-mode)
|
||||||
:config
|
:config
|
||||||
(setq nrepl-log-messages nil
|
(setq nrepl-hide-special-buffers t
|
||||||
nrepl-hide-special-buffers t
|
nrepl-log-messages nil
|
||||||
cider-font-lock-dynamically '(macro core function var)
|
cider-font-lock-dynamically '(macro core function var)
|
||||||
cider-overlays-use-font-lock t
|
cider-overlays-use-font-lock t
|
||||||
cider-prompt-for-symbol nil
|
cider-prompt-for-symbol nil
|
||||||
cider-repl-display-help-banner nil
|
cider-repl-display-help-banner nil
|
||||||
cider-repl-pop-to-buffer-on-connect t
|
cider-repl-history-display-duplicates nil
|
||||||
|
cider-repl-history-display-style 'one-line
|
||||||
|
cider-repl-history-file (concat doom-cache-dir "cider-repl-history")
|
||||||
|
cider-repl-history-highlight-current-entry t
|
||||||
|
cider-repl-history-quit-action 'delete-and-restore
|
||||||
|
cider-repl-history-highlight-inserted-item t
|
||||||
|
cider-repl-history-size 1000
|
||||||
|
cider-repl-pop-to-buffer-on-connect 'display-only
|
||||||
|
cider-repl-result-prefix ";; => "
|
||||||
|
cider-repl-print-length 100
|
||||||
|
cider-repl-use-clojure-font-lock t
|
||||||
cider-repl-use-pretty-printing t
|
cider-repl-use-pretty-printing t
|
||||||
cider-repl-wrap-history nil
|
cider-repl-wrap-history nil
|
||||||
cider-repl-history-display-duplicates nil
|
cider-stacktrace-default-filters '(tooling dup))
|
||||||
cider-repl-history-file (concat doom-cache-dir "cider-repl-history")
|
|
||||||
cider-stacktrace-default-filters '(tooling dup)
|
(when (featurep! :feature evil +everywhere)
|
||||||
cider-repl-use-clojure-font-lock t)
|
(evil-define-key 'insert cider-repl-mode-map
|
||||||
|
[S-return] #'cider-repl-newline-and-indent)
|
||||||
|
(evil-define-key 'normal cider-repl-history-mode-map
|
||||||
|
"q" 'cider-repl-history-quit
|
||||||
|
[return] 'cider-repl-history-insert-and-quit
|
||||||
|
"l" 'cider-repl-history-occur
|
||||||
|
"s" 'cider-repl-history-search-forward
|
||||||
|
"r" 'cider-repl-history-search-backward
|
||||||
|
"U" 'cider-repl-history-undo-other-window))
|
||||||
|
|
||||||
;; TODO: Add mode-local labels when general support is in.
|
;; TODO: Add mode-local labels when general support is in.
|
||||||
(map! :localleader
|
(map! :localleader
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue