diff --git a/emacs/init.org b/emacs/init.org index 971aa20..f6a478a 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -5438,3 +5438,32 @@ necessary on Linux. :if (eq window-system 'x) :hook (after-init . clipmon-mode-start)) #+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