Fix which-key entries: gr and gs in dired and magit

problem:
pressing g shows the which-key entry:
r -> evil-mc

but it calls the expected commands:
revert-buffer (in dired)
magit-refresh

s -> evil-easymotion
but it calls the expected command:
magit-jump-to-staged

solution:
removing the gr and gs which-key entries,
shows the expected commands.
This commit is contained in:
duianto 2021-01-30 09:57:38 +01:00
parent 86a89d8fdd
commit ec57b21a92
3 changed files with 18 additions and 2 deletions

View File

@ -253,7 +253,14 @@
(evil-define-key 'normal magit-section-mode-map (kbd "M-6") 'spacemacs/winum-select-window-6)
(evil-define-key 'normal magit-section-mode-map (kbd "M-7") 'spacemacs/winum-select-window-7)
(evil-define-key 'normal magit-section-mode-map (kbd "M-8") 'spacemacs/winum-select-window-8)
(evil-define-key 'normal magit-section-mode-map (kbd "M-9") 'spacemacs/winum-select-window-9))))
(evil-define-key 'normal magit-section-mode-map (kbd "M-9") 'spacemacs/winum-select-window-9)
;; Remove inherited bindings from evil-mc and evil-easymotion
;; do this after the config to make sure the keymap is available
(which-key-add-keymap-based-replacements magit-mode-map
"<normal-state> g r" nil
"<visual-state> g r" nil
"<normal-state> g s" nil
"<visual-state> g s" nil))))
(defun git/init-magit-delta ()
(use-package magit-delta

View File

@ -121,6 +121,13 @@ If not in such a search box, fall back on `Custom-newline'."
(defalias 'spacemacs/display-buffer-other-frame 'display-buffer-other-frame)
(defalias 'spacemacs/find-file-and-replace-buffer 'find-alternate-file)
(defun spacemacs/dired-remove-evil-mc-gr-which-key-entry ()
;; Remove inherited bindings from evil-mc
;; do this after the config to make sure the keymap is available
(which-key-add-keymap-based-replacements dired-mode-map
"<normal-state> g r" nil
"<visual-state> g r" nil))
(defun spacemacs/indent-region-or-buffer ()
"Indent a region if selected, otherwise the whole buffer."
(interactive)

View File

@ -125,7 +125,9 @@
(evil-define-key 'normal dired-mode-map (kbd "N") 'evil-ex-search-previous))
(when (eq 'hybrid dotspacemacs-editing-style)
(evil-define-key 'normal dired-mode-map (kbd "n") 'evil-search-next)
(evil-define-key 'normal dired-mode-map (kbd "N") 'evil-search-previous)))
(evil-define-key 'normal dired-mode-map (kbd "N") 'evil-search-previous))
(add-hook 'spacemacs-post-user-config-hook
'spacemacs/dired-remove-evil-mc-gr-which-key-entry))
(defun spacemacs-defaults/init-dired-x ()
(use-package dired-x