From 4336587f8ebae67e99f9d9c59daa8bf1cf1c51e4 Mon Sep 17 00:00:00 2001 From: James Nguyen Date: Mon, 23 May 2022 17:35:41 -0400 Subject: [PATCH] [Magit]: Add new customs to bind $ and 0 --- modes/magit/evil-collection-magit.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modes/magit/evil-collection-magit.el b/modes/magit/evil-collection-magit.el index 395d29e..c827c81 100644 --- a/modes/magit/evil-collection-magit.el +++ b/modes/magit/evil-collection-magit.el @@ -102,6 +102,20 @@ When this option is enabled, the stash popup is available on \"Z\"." :group 'magit :type 'boolean) +(defcustom evil-collection-magit-use-$-for-end-of-line t + "When non nil, use \"$\" for `evil-end-of-line'. + +Move `magit-process-buffer' to \"`\"." + :group 'magit + :type 'boolean) + +(defcustom evil-collection-magit-use-0-for-beginning-of-line t + "When non nil, use \"0\" for `evil-beginning-of-line'. + +Move `magit-diff-default-context' to \"~\"." + :group 'magit + :type 'boolean) + (defcustom evil-collection-magit-state (if evil-collection-magit-use-y-for-yank 'normal 'motion) "State to use for most magit buffers." :group 'magit @@ -372,6 +386,14 @@ When this option is enabled, the stash popup is available on \"Z\"." (,states magit-mode-map "V" set-mark-command) (,states magit-mode-map ,(kbd "") evil-collection-magit-maybe-deactivate-mark))) + (when evil-collection-magit-use-$-for-end-of-line + `((,states magit-mode-map "$" evil-end-of-line) + (,states magit-mode-map "`" magit-process-buffer))) + + (when evil-collection-magit-use-0-for-beginning-of-line + `((,states magit-mode-map "0" evil-beginning-of-line) + (,states magit-mode-map "~" magit-diff-default-context))) + (when evil-collection-magit-use-z-for-folds `((,states magit-mode-map "Z" magit-stash) (,states magit-mode-map "z")