feat(emacs): bind C-o in cider inspector
This commit is contained in:
@@ -32,52 +32,53 @@
|
|||||||
:load-buffer #'cider-load-buffer)
|
:load-buffer #'cider-load-buffer)
|
||||||
(add-hook 'cider-repl-mode-hook #'syd-lisp-mode)
|
(add-hook 'cider-repl-mode-hook #'syd-lisp-mode)
|
||||||
(syd-push shackle-rules
|
(syd-push shackle-rules
|
||||||
`("*cider-doc*" ,@syd-help-popup-options)
|
`("*cider-doc*" ,@syd-help-popup-options)
|
||||||
'("*cider-test-report*")
|
'("*cider-test-report*")
|
||||||
'("*cider-error*")))
|
'("*cider-error*")))
|
||||||
|
|
||||||
(use-package cider-mode
|
(use-package cider-mode
|
||||||
:straight nil ; Part of `cider'.
|
:straight nil ; Part of `cider'.
|
||||||
:hook (clojure-mode-local-vars . cider-mode)
|
:hook (clojure-mode-local-vars . cider-mode)
|
||||||
:custom ((cider-show-error-buffer nil)
|
:custom ((cider-show-error-buffer nil)
|
||||||
;; Download Java source archives for local Javadoc and jump-to-def
|
;; Download Java source archives for local Javadoc and jump-to-def
|
||||||
;; functionality.
|
;; functionality.
|
||||||
(cider-download-java-sources t))
|
(cider-download-java-sources t))
|
||||||
:general
|
:general
|
||||||
;; DEPRECATED: Remove once a `map!' equivalent is implemented.
|
|
||||||
(:keymaps 'cider-repl-mode-map
|
(:keymaps 'cider-repl-mode-map
|
||||||
:states '(normal insert)
|
:states '(normal insert)
|
||||||
"C-k" #'cider-repl-backward-input
|
"C-k" #'cider-repl-backward-input
|
||||||
"C-j" #'cider-repl-forward-input
|
"C-j" #'cider-repl-forward-input
|
||||||
"C-s" #'consult-history)
|
"C-s" #'consult-history)
|
||||||
;; DEPRECATED: Remove once a `map!' equivalent is implemented.
|
|
||||||
(:keymaps '(cider-repl-mode-map clojure-mode-map)
|
(:keymaps '(cider-repl-mode-map clojure-mode-map)
|
||||||
:states '(normal visual motion emacs insert)
|
:states '(normal visual motion emacs insert)
|
||||||
:major-modes t
|
:major-modes t
|
||||||
:prefix syd-localleader-key
|
:prefix syd-localleader-key
|
||||||
:non-normal-prefix syd-alt-localleader-key
|
:non-normal-prefix syd-alt-localleader-key
|
||||||
"\"" #'cider-jack-in-cljs
|
"\"" #'cider-jack-in-cljs
|
||||||
"'" #'cider-jack-in-clj
|
"'" #'cider-jack-in-clj
|
||||||
"c" #'cider-connect-clj
|
"c" #'cider-connect-clj
|
||||||
"C" #'cider-connect-cljs
|
"C" #'cider-connect-cljs
|
||||||
"r l" #'cider-load-buffer
|
"r l" #'cider-load-buffer
|
||||||
"r n" #'cider-repl-set-ns
|
"r n" #'cider-repl-set-ns
|
||||||
"r r" #'cider-ns-refresh
|
"r r" #'cider-ns-refresh
|
||||||
"r R" #'cider-restart
|
"r R" #'cider-restart
|
||||||
"r q" #'cider-quit
|
"r q" #'cider-quit
|
||||||
"d d" #'cider-debug-defun-at-point
|
"d d" #'cider-debug-defun-at-point
|
||||||
"M-:" #'cider-read-and-eval
|
"M-:" #'cider-read-and-eval
|
||||||
"h d" #'cider-doc
|
"h d" #'cider-doc
|
||||||
"h c" #'cider-cheatsheet
|
"h c" #'cider-cheatsheet
|
||||||
"h j" #'cider-javadoc
|
"h j" #'cider-javadoc
|
||||||
"h n" #'cider-browse-ns
|
"h n" #'cider-browse-ns
|
||||||
"T n" #'cider-test-run-ns-tests
|
"T n" #'cider-test-run-ns-tests
|
||||||
"T r" #'cider-test-rerun-failed-tests
|
"T r" #'cider-test-rerun-failed-tests
|
||||||
"T R" #'cider-test-rerun-test
|
"T R" #'cider-test-rerun-test
|
||||||
"x" #'cider-scratch)
|
"x" #'cider-scratch)
|
||||||
(:keymaps 'cider-repl-mode-map
|
(:keymaps 'cider-repl-mode-map
|
||||||
:states 'insert
|
:states 'insert
|
||||||
"S-<return>" #'cider-repl-newline-and-indent)
|
"S-<return>" #'cider-repl-newline-and-indent)
|
||||||
|
(:keymaps 'cider-inspector-mode-map
|
||||||
|
:states '(motion insert)
|
||||||
|
"C-o" #'cider-inspector-pop)
|
||||||
:config
|
:config
|
||||||
(add-hook 'cider-mode-hook #'eldoc-mode)
|
(add-hook 'cider-mode-hook #'eldoc-mode)
|
||||||
(with-eval-after-load 'consult
|
(with-eval-after-load 'consult
|
||||||
@@ -90,19 +91,19 @@
|
|||||||
(syd-add-hook 'cider-repl-preoutput-hook
|
(syd-add-hook 'cider-repl-preoutput-hook
|
||||||
(defun syd-clojure--render-graphviz-h (s)
|
(defun syd-clojure--render-graphviz-h (s)
|
||||||
(if (string-match (rx bol "!!!graph:"
|
(if (string-match (rx bol "!!!graph:"
|
||||||
(group (* anychar) ".svg"))
|
(group (* anychar) ".svg"))
|
||||||
s)
|
s)
|
||||||
(let ((beg (match-beginning 0))
|
(let ((beg (match-beginning 0))
|
||||||
(end (match-end 0))
|
(end (match-end 0))
|
||||||
(file (match-string 1 s)))
|
(file (match-string 1 s)))
|
||||||
(message "%d %d %s" beg end file)
|
(message "%d %d %s" beg end file)
|
||||||
(add-display-text-property
|
(add-display-text-property
|
||||||
beg end
|
beg end
|
||||||
'display
|
'display
|
||||||
`(image :type svg
|
`(image :type svg
|
||||||
:file ,file)
|
:file ,file)
|
||||||
s)
|
s)
|
||||||
s)
|
s)
|
||||||
s))))
|
s))))
|
||||||
|
|
||||||
(provide 'syd/clojure)
|
(provide 'syd/clojure)
|
||||||
|
|||||||
Reference in New Issue
Block a user