dired-hide-dotfiles
dired-hide-dotfiles copied to clipboard
Directions for setting '.' key does not work in Emacs 29.1
When adding your suggested lines to my init.el I get the following warning from Emacs, and it fails to load the remainder of the init.el file:
⛔ Warning (initialization): An error occurred while loading ‘/Users/mok/.emacs.d/init.el’:
Symbol's value as variable is void: dired-mode-map
Ah.
You should probably:
(defun my-dired-mode-hook ()
"My `dired' mode hook."
;; To hide dot-files by default
(dired-hide-dotfiles-mode))
(with-eval-after-load 'dired
(define-key dired-mode-map "." #'dired-hide-dotfiles-mode)
(add-hook 'dired-mode-hook #'my-dired-mode-hook))
If that works and you feel like it, please send a PR.
Thank you for your suggestion, unfortunately it does not work for me, I am not sure what is going on but it may interfere with the completion framework. Hitting '.' makes dired change directory to the parent even though I mapped it like you propose.
I will just live with the fact that dotfiles are not visible for now :-)