From 09b3004abe899a06e6d034cf2535b26b657ef1ea Mon Sep 17 00:00:00 2001 From: Luis Osa Date: Sat, 19 Mar 2022 16:18:58 +0100 Subject: [PATCH] feat(magit): add evil keybinds for code-review Add the two main keybindings expected in the README of code-review: `r` for a transient menu with all actions and `RET` to add or edit a comment. Both should only be enabled while in a `*Code Review*` buffer. Ref: https://github.com/wandersoncferreira/code-review --- modules/tools/magit/config.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/tools/magit/config.el b/modules/tools/magit/config.el index 425ffc7c7..0333b38d5 100644 --- a/modules/tools/magit/config.el +++ b/modules/tools/magit/config.el @@ -236,7 +236,10 @@ ensure it is built when we actually use Forge." (evil-define-key* 'normal magit-status-mode-map [escape] nil) (after! code-review - (undefine-key! code-review-mode-map "M-1" "M-2" "M-3" "M-4" "1" "2" "3" "4" "0")) + (undefine-key! code-review-mode-map "M-1" "M-2" "M-3" "M-4" "1" "2" "3" "4" "0") + (map! :map code-review-mode-map + :n "r" #'code-review-transient-api + :n "RET" #'code-review-comment-add-or-edit)) ;; Some extra vim-isms I thought were missing from upstream (evil-define-key* '(normal visual) magit-mode-map