Reorganize modules
This commit is contained in:
parent
50ea98319f
commit
f453b3cee1
55 changed files with 0 additions and 1535 deletions
41
core/core-debug.el
Normal file
41
core/core-debug.el
Normal file
|
@ -0,0 +1,41 @@
|
|||
;;; custom-debug.el --- debugging with `realgud'
|
||||
|
||||
(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
|
||||
:m "n" 'realgud:cmd-next
|
||||
:m "b" 'realgud:cmd-break
|
||||
:m "B" 'realgud:cmd-clear
|
||||
:n "c" 'realgud:cmd-continue)
|
||||
|
||||
;; Popup rules
|
||||
(def-popup! "\\`\\*\\(g\\|zsh\\|bash\\)db.*?\\*\\'" :size 20 :regexp t)
|
||||
(def-popup! "\\`\\*trepanjs.*?\\*\\'" :size 20 :regexp t)
|
||||
|
||||
;; Temporary Ex commands for the debugger
|
||||
(def-tmp-excmd! doom:def-debug-on doom:def-debug-off
|
||||
("n[ext]" . realgud:cmd-next)
|
||||
("s[tep]" . realgud:cmd-step)
|
||||
("b[reak]" . doom:debug-toggle-breakpoint)
|
||||
("c[ontinue]" . realgud:cmd-continue))
|
||||
|
||||
;; TODO does this work with shackle?
|
||||
(advice-add 'realgud-cmdbuf-init :after 'doom:def-debug-on)
|
||||
(advice-add 'realgud:cmd-quit :after 'doom:def-debug-off)
|
||||
;; Monkey-patch `realgud:run-process' to run in a popup.
|
||||
(advice-add 'realgud:run-process :override 'doom*realgud:run-process))
|
||||
|
||||
(provide 'custom-debug)
|
||||
;;; custom-debug.el ends here
|
51
core/core-jump.el
Normal file
51
core/core-jump.el
Normal file
|
@ -0,0 +1,51 @@
|
|||
;;; custom-tags.el
|
||||
|
||||
;; TODO Finish me!
|
||||
|
||||
(defvar doom-ctags-alist
|
||||
'((ruby-mode :exec "ripper-tags -R -f %t --emacs")
|
||||
(c++-mode :ext "cpp")
|
||||
(c-mode :ext "c")
|
||||
(all :exec "find . -type f -iname \"*.%e\" | ctags -e -f %t -")
|
||||
;; TODO add c-mode/c++-mode ctags
|
||||
))
|
||||
|
||||
|
||||
(add-hook 'find-file-hook 'doom|init-tags)
|
||||
(defun doom|init-tags ()
|
||||
(awhen (doom/tags-p)
|
||||
(setq tags-table-list (list it))))
|
||||
|
||||
;; TODO
|
||||
;; (defun doom/tags-generate ()
|
||||
;; (interactive)
|
||||
;; (let ((command (assoc major-mode doom-ctags-alist))
|
||||
;; (default-directory (doom/project-root)))
|
||||
;; (unless command
|
||||
;; (user-error "No tag generator for %s" major-mode))
|
||||
;; (async-shell-command command "*doom:generate-tags*")))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/find-def ()
|
||||
"Find definition using tags, falling back to dumb-jump otherwise."
|
||||
(interactive)
|
||||
(let ((orig-pt (point))
|
||||
(orig-file (buffer-file-name)))
|
||||
(cond ((and (doom/tags-p)
|
||||
;; TODO
|
||||
;; (progn (call-interactively 'helm-etags-select)
|
||||
;; (and (/= orig-pt (point))
|
||||
;; (f-same? orig-file buffer-file-name)))
|
||||
))
|
||||
((progn (dumb-jump-go)
|
||||
(and (/= orig-pt (point))
|
||||
(f-same? orig-file buffer-file-name))))
|
||||
(t (call-interactively 'evil-goto-definition)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/tags-p ()
|
||||
(let ((path (expand-file-name ".tags" (doom/project-root))))
|
||||
(and (f-exists? path) path)))
|
||||
|
||||
(provide 'custom-tags)
|
||||
;;; custom-tags.el ends here
|
Loading…
Add table
Add a link
Reference in a new issue