Add hydra for GUD

This commit is contained in:
Jeremy Dormitzer 2020-02-25 13:29:24 -05:00
parent 2f01a82bd5
commit dd354e9046

View File

@ -5438,3 +5438,32 @@ necessary on Linux.
:if (eq window-system 'x) :if (eq window-system 'x)
:hook (after-init . clipmon-mode-start)) :hook (after-init . clipmon-mode-start))
#+END_SRC #+END_SRC
* GUD
Emacs ships with a built-in debugger interface that I primarily use
for PDB. The default keybindings are RSI-inducing, so here's a hydra
to use instead:
#+BEGIN_SRC emacs-lisp
(defhydra hydra-gud (:hint nil)
"
_n_: step over _b_: set breakpoint _e_: execute statement _l_: refresh buffer
_s_: step into _d_: remove breakpoint _p_: print statement _q_: quit hyra
_>_: up stack frame _f_: finish function _w_: watch expression
_<_: down stack frame _c_: continue
"
(">" gud-up)
("<" gud-down)
("b" gud-break)
("d" gud-remove)
("e" gud-statement)
("f" gud-finish)
("l" gud-refresh)
("n" gud-next)
("p" gud-print)
("c" gud-cont :color blue)
("s" gud-step)
("w" gud-watch)
("q" nil))
(leader-def-key "cg" #'hydra-gud/body)
#+END_SRC