Add embark keymap for Forge actions

This commit is contained in:
Jeremy Dormitzer 2024-04-22 12:52:58 -04:00
parent 2b1a828021
commit 1005bb6feb

View File

@ -112,6 +112,18 @@ targets."
"U" #'password-store-url)
(add-to-list 'embark-keymap-alist '(password-store . embark-password-store-actions))
(add-to-list 'embark-target-injection-hooks '(xref-find-references embark--ignore-target))
(with-eval-after-load 'forge
(defun embark-target-finder-forge ()
"Identify Forge commits/issues/PRs at point."
(when-let ((target (forge--browse-target)))
`(forge . ,(format "%s" target)))))
(add-to-list 'embark-target-finders #'embark-target-finder-forge)
(defvar-keymap embark-forge-actions
:doc "Keymap for actions for forge."
:parent embark-general-map
"RET" #'forge-browse
"y" #'forge-copy-url-at-point-as-kill)
(add-to-list 'embark-keymap-alist '(forge . embark-forge-actions))
:general
((emacs normal motion insert visual) "C-." #'embark-act)
((emacs normal motion insert visual) "M-." #'embark-dwim)