doomemacs/core/core-eval.el

75 lines
2.2 KiB
EmacsLisp
Raw Normal View History

2015-12-20 02:26:34 -05:00
;;; core-eval.el
2015-06-15 09:05:52 +02:00
;; + Running inline code + REPLs (using `quickrun' + `repl-toggle')
;; + Almost-universal debugging (with `realgud')
;; + Simple code navigation (using `dump-jump' and `imenu-list')
;; + A universal tags config (WIP)
2016-05-20 19:08:02 -04:00
;; remove ellipsis when printing sexp in message buffer
(setq eval-expression-print-length nil
eval-expression-print-level nil)
2015-06-15 09:05:52 +02:00
(use-package quickrun
:commands (quickrun
quickrun-region
quickrun-with-arg
quickrun-shell
quickrun-compile-only
quickrun-replace-region
2015-06-24 15:39:13 +02:00
helm-quickrun)
2016-05-20 19:08:02 -04:00
:init (add-hook 'quickrun/mode-hook 'linum-mode)
:config (setq quickrun-focus-p nil))
2015-06-15 09:05:52 +02:00
2015-11-25 06:00:49 -05:00
(use-package repl-toggle
:commands (rtog/toggle-repl rtog/add-repl)
2015-12-09 01:54:30 -05:00
:init
2016-05-20 22:37:30 -04:00
(defvar doom--repl-buffer nil)
(defvar-local repl-p nil)
2016-05-20 19:08:02 -04:00
(setq rtog/mode-repl-alist '())
2016-02-20 15:32:19 -05:00
(add-hook! repl-toggle-mode
2015-12-20 02:26:34 -05:00
(evil-initialize-state 'emacs)
2016-03-04 22:39:48 -05:00
(setq repl-p t))
2016-02-20 15:32:19 -05:00
:config
(map! :map repl-toggle-mode-map
2016-02-23 13:09:15 -05:00
:ei "C-n" 'comint-next-input
:ei "C-p" 'comint-previous-input
:ei "<down>" 'comint-next-input
:ei "<up>" 'comint-previous-input))
2015-11-25 06:00:49 -05:00
;;
(after! debug
;; For elisp debugging
(map! :map debugger-mode-map
:n "RET" 'debug-help-follow
:n "n" 'debugger-step-through
:n "c" 'debugger-continue))
(use-package realgud
:commands (realgud:gdb realgud:trepanjs realgud:bashdb realgud:zshdb)
:config
(map! :map realgud:shortkey-mode-map
:n "j" 'evil-next-line
:n "k" 'evil-previous-line
:n "h" 'evil-backward-char
:n "l" 'evil-forward-char
;; FIXME Greedy command buffer always grabs focus
:m "n" 'realgud:cmd-next
:m "b" 'realgud:cmd-break
:m "B" 'realgud:cmd-clear
:n "c" 'realgud:cmd-continue)
;; Temporary Ex commands for the debugger
2016-05-20 22:37:30 -04:00
(def-tmp-excmd! doom:def-debug-on doom:def-debug-off
("n[ext]" . realgud:cmd-next)
("s[tep]" . realgud:cmd-step)
2016-05-20 22:37:30 -04:00
("b[reak]" . doom:debug-toggle-breakpoint)
("c[ontinue]" . realgud:cmd-continue))
2016-05-20 22:37:30 -04:00
(advice-add 'realgud-cmdbuf-init :after 'doom:def-debug-on)
(advice-add 'realgud:cmd-quit :after 'doom:def-debug-off))
2015-12-20 02:26:34 -05:00
(provide 'core-eval)
;;; core-eval.el ends here