         (apply command args))
     (apply command args)))
 
+(defmacro evil-collection-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-collection-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-collection-cider-make-debug-command "next"
+                                          "continue"
+                                          "out"
+                                          "quit"
+                                          "eval"
+                                          "inject"
+                                          "inspect"
+                                          "locals")
+
 (defun evil-collection-cider-setup ()
   "Set up `evil' bindings for `cider'."
   (unless evil-move-beyond-eol

    (advice-add 'cider-eval-last-sexp-to-repl :around 'evil-collection-cider-last-sexp)
    (with-eval-after-load 'cider-eval-sexp-fu
      (advice-add 'cider-esf--bounds-of-last-sexp :around 'evil-collection-cider-last-sexp)))

  (evil-define-key '(normal visual) cider-mode-map
    "gd" 'cider-find-var

;; Evil bindings for Cider.

;;; Code:
(require 'cl-macs)
(require 'cider nil t)
(require 'evil)
(require 'evil-collection-settings)

(declare-function cider-debug-mode-send-reply "cider-debug")

(defun evil-collection-cider-last-sexp (command &rest args)
  "In normal-state or motion-state, last sexp ends at point."
