Add dap-mode transient

This commit is contained in:
Jeremy Dormitzer 2020-01-02 17:06:35 -05:00
parent 8301e16752
commit 39c6c8eae0

View File

@ -211,6 +211,11 @@ Adds Evil commands to comment out lines of code:
(general-def 'normal messages-buffer-mode-map "SPC" leader-map :keymaps 'override)
#+END_SRC
* Transient
A framework for creating Magit-style popups:
#+BEGIN_SRC emacs-lisp
(use-package transient)
#+END_SRC
* Magit
Magit is objectively the best Git interface.
#+BEGIN_SRC emacs-lisp
@ -1637,38 +1642,41 @@ Emacs support for the Language Server Protocol
lsp-ui-sideline-update-mode 'point))
(use-package dap-mode
:after (lsp-mode)
:commands (dap-debug dap-debug-edit-template)
:hook (prog-mode . (lambda ()
(dap-mode 1)
(dap-ui-mode 1)
(dap-tooltip-mode 1)))
:init
(defvar dap-commands (make-sparse-keymap))
(jdormit/define-prefix "cm" "dap")
(define-transient-command dap-dispatch
"Dispatcher popup for dap-mode commands"
["Launching"
("d" "Start debugger" dap-debug)]
["Debugging"
("n" "Next" dap-next)
("i" "Step in" dap-step-in)
("o" "Step out" dap-step-out)
("c" "Continue" dap-continue)
("r" "Restart frame" dap-restart-frame)
("l" "View locals" dap-ui-locals)
("e" "Eval" dap-eval)
("x" "Inspect" dap-ui-inspect)
("Q" "Disconnect" dap-disconnect)]
["Breakpoints"
("b" "Toggle breakpoint" dap-breakpoint-toggle)
("B" "View breakpoints" dap-ui-breakpoints)]
["Misc."
("T" "Edit template" dap-debug-edit-template)
("h" "Hydra" dap-hydra)])
:config
(require 'dap-python)
:general
(dap-commands
"d" 'dap-debug
"T" 'dap-debug-edit-template
"n" 'dap-next
"i" 'dap-step-in
"o" 'dap-step-out
"c" 'dap-continue
"r" 'dap-restart-frame
"l" 'dap-ui-locals
"h" 'dap-hydra
"b" 'dap-breakpoint-toggle
"B" 'dap-ui-breakpoints-ui-list
"e" 'dap-eval
"x" 'dap-ui-inspect)
(leader-map "cm" dap-commands))
(leader-map "cm" 'dap-dispatch)
((normal visual motion) "zd" 'dap-dispatch))
(dap-mode 1)
(dap-ui-mode 1)
(dap-tooltip-mode 1)
(with-eval-after-load 'lsp-clients
(defun lsp-typescript-javascript-tsx-jsx-activate-p (filename major-mode)
"Checks if the javascript-typescript language server should be enabled
based on FILE-NAME and MAJOR-MODE"
based on FILE-NAME and MAJOR-MODE"
(or (member major-mode '(typescript-mode typescript-tsx-mode js-mode js2-mode rjsx-mode))
(and (eq major-mode 'web-mode)
(or (string-suffix-p ".tsx" filename t)