alexluigit / dirvish

A polished Dired with batteries included.
GNU General Public License v3.0
769 stars 43 forks source link

[Bug] dirvish-mode-map doesn't appear to be activated #188

Open p00f opened 1 year ago

p00f commented 1 year ago

Thank you for the bug report

Bug description

dirvish-mode-map is not activated in the dirvish buffer for me. I have this:

(use-package dirvish
  :init
  (dirvish-override-dired-mode)
  :custom
  (dirvish-quick-access-entries ; It's a custom option, `setq' won't work
   '(("h" "~/"                          "Home")
     ("d" "~/Downloads/"                "Downloads")
     ("s" "~/stuff"                     "Stuff")
     ("a" "~/acads"                     "Acads")))
  :general
  (:keymaps 'dirvish-mode-map
   "a"   'dirvish-quick-access
   "q"   'dirvish-quit
   "f"   'dirvish-file-info-menu
   "y"   'dirvish-yank-menu
   "N"   'dirvish-narrow
   "^"   'dirvish-history-last
   "h"   'dirvish-history-jump
   "s"   'dirvish-quicksort
   "v"   'dirvish-vc-menu
   "TAB" 'dirvish-subtree-toggle
   "M-f" 'dirvish-history-go-forward
   "M-b" 'dirvish-history-go-backward
   "M-l" 'dirvish-ls-switches-menu
   "M-m" 'dirvish-mark-menu
   "M-t" 'dirvish-layout-toggle
   "M-s" 'dirvish-setup-menu
   "M-e" 'dirvish-emerge-menu
   "M-j" 'dirvish-fd-jump))

describe-keymap dirvish-mode-map shows these bindings: https://paste.sr.ht/~p00f/8302425f5fb660c7744853174a8664884a6a300e

but describe-mode doesn't show dirvish:

Minor modes enabled in this buffer: Anzu Corfu Dired-Hide-Details Evil-Collection-Unimpaired Evil-Local Evil-Surround Font-Lock Ligature Origami Pdf-Occur-Dired Tree-Sitter Yas

The major mode is Dired by name mode defined in dired.el:

I also removed dired modes from evil-collection-mode-list just to be sure:

(use-package evil-collection
  :after evil
  :config
  (dolist (mode '(dired dired-sidebar wdired))
    (delete mode evil-collection-mode-list))
  (evil-collection-init))

Steps to reproduce

M-x dirvish, then press something you bound in dirvish-mode-map

Expected behavior

The key works

OS

Linux

Emacs Version

gccemacs-29

Emacs Configurations

https://git.sr.ht/~p00f/dotfiles/tree/ganymede/emacs/.config/emacs/init.el

Error callstack

No response

Anything else

I'm actually using emacs 30 (master) but there was no such option

Ziqi-Yang commented 1 year ago

Same problem here. BTW, I also use evil, and my emacs version is 29.

kmontag commented 1 year ago

I was able to fix this by adding the following to my config:

(evil-make-overriding-map dirvish-mode-map 'normal)

I'm on Emacs 29 with the latest dirvish / evil.

Schievel1 commented 9 months ago

Maybe its important to say this goes into :config in the use-package form of dirvish to make it fire after the dirvish-mode-map is available. Or after the use-package form at all.