From 37bfe8f87103637a7ac248e667b3a051c4fe7aab Mon Sep 17 00:00:00 2001 From: Raul Benencia Date: Mon, 12 Feb 2024 10:48:05 -0300 Subject: emacs: +dired-preview --- .emacs.d/init.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index f69233f..3347127 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -135,6 +135,28 @@ (setq vc-follow-symlinks nil) ;; dired +(use-package dired-preview + :ensure t + :config + + (setq dired-preview-delay 0.3) + (setq dired-preview-max-size (expt 2 20)) + (setq dired-preview-ignored-extensions-regexp + (concat "\\." + "\\(mkv\\|webm\\|mp4\\|mp3\\|ogg\\|m4a" + "\\|gz\\|zst\\|tar\\|xz\\|rar\\|zip" + "\\|iso\\|epub\\|pdf\\)")) + + (defun my-dired-preview-to-the-right () + "My preferred `dired-preview-display-action-alist-function'." + '((display-buffer-in-side-window) + (side . right) + (width . 0.3))) + + (setq dired-preview-display-action-alist-function #'my-dired-preview-to-the-right) + + (dired-preview-global-mode 1)) + (add-hook 'dired-mode-hook #'dired-hide-details-mode) (setq dired-guess-shell-alist-user @@ -189,3 +211,4 @@ (load-file file)) ;; init.el ends here +(put 'dired-find-alternate-file 'disabled nil) -- cgit v1.2.3