Skip to content

Instantly share code, notes, and snippets.

@philjackson
Created August 3, 2018 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philjackson/53014a2cfbc47dfb5b2eef44cb0374a9 to your computer and use it in GitHub Desktop.
Save philjackson/53014a2cfbc47dfb5b2eef44cb0374a9 to your computer and use it in GitHub Desktop.
(defmacro evil-helper-cider-make-debug-command (&rest cider-commands)
"Make functions that wrap `cider-debug' commands.
Cider debug commands are sent through
`cider-debug-mode-send-reply'. ex. \(cider-debug-mode-send-reply
\":next\"\)"
(let ((commands (if (consp cider-commands)
cider-commands
(list cider-commands))))
`(progn
,@(cl-loop
for command in commands
collect
(let ((funsymbol
(intern (format "evil-helper-cider-debug-%s" command))))
`(defun ,funsymbol ()
,(format
"Send :%s to `cider-debug-mode-send-reply'." command)
(interactive)
(cider-debug-mode-send-reply ,(format ":%s" command))))))))
(evil-helper-cider-make-debug-command "next"
"continue"
"out"
"quit"
"eval"
"inject"
"inspect"
"locals")
(define-clojure-indent
(defroutes 'defun)
(GET 2)
(POST 2)
(PUT 2)
(DELETE 2)
(HEAD 2)
(ANY 2)
(OPTIONS 2)
(PATCH 2)
(rfn 2)
(let-routes 1)
(context 2))
(evil-set-initial-state 'cider-stacktrace-mode 'normal)
(evil-define-key 'normal cider-stacktrace-mode-map
(kbd "q") cider-popup-buffer-quit-function)
(evil-set-initial-state 'cider-test-report-mode 'normal)
(evil-define-key 'normal cider-test-report-mode-map
(kbd "q") cider-popup-buffer-quit-function)
(evil-leader/set-key-for-mode 'clojure-mode
"tt" 'cider-test-run-ns-tests
"tf" 'cider-test-rerun-failed-tests
"eb" 'cider-eval-buffer)
(evil-define-key 'normal cider--debug-mode-map
"q" evil-helper-cider-debug-quit)
(evil-define-key 'normal cider--debug-mode-map
"n" evil-helper-cider-debug-next)
(evil-define-key 'normal cider--debug-mode-map
"c" evil-helper-cider-debug-continue)
(evil-define-key 'normal cider--debug-mode-map
"L" evil-helper-cider-debug-locals)
(provide 'cider-config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment