From 700e602eab115b12ff9b0bd2d7f7732b50b92156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Sun, 27 Oct 2024 14:49:45 -0700 Subject: emacs: move dired config from init.el to rul-fm.el --- .emacs.d/init.el | 35 ++--------------------------------- .emacs.d/rul-lisp/packages/rul-fm.el | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 33 deletions(-) create mode 100644 .emacs.d/rul-lisp/packages/rul-fm.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 6b4e0de..2fc32fb 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -140,38 +140,7 @@ ;; (desktop-save-mode 1) ;; It's easier to get to magit if symlinks are followed. -(setq vc-follow-symlinks t) - -;; dired -(use-package dired-preview - :ensure t - :config - - (setq dired-preview-delay 0.5) - (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\\)")) - - (dired-preview-global-mode 1)) - -(add-hook 'dired-mode-hook #'dired-hide-details-mode) - -(setq dired-guess-shell-alist-user - '(("\\.\\(png\\|jpe?g\\|tiff\\)" "feh" "xdg-open") - ("\\.\\(mp[34]\\|m4a\\|ogg\\|flac\\|webm\\|mkv\\)" "mpv" "xdg-open") - (".*" "xdg-open"))) - -(setq dired-kill-when-opening-new-dired-buffer t) - -;;; Icons -(use-package nerd-icons :ensure t ) -(use-package nerd-icons-dired :ensure t - :config - (add-hook 'dired-mode-hook #'nerd-icons-dired-mode) - ) +(setq vc-follow-symlinks t) ;; drop (dolist (path '("~/.emacs.d/rul-lisp/config" "~/.emacs.d/rul-lisp/packages")) (add-to-list 'load-path path)) @@ -179,6 +148,7 @@ (pixel-scroll-precision-mode 1) (require 'rul-completion) +(require 'rul-fm) (require 'rul-prog) (require 'rul-elfeed) (require 'rul-modeline) @@ -211,4 +181,3 @@ (load-file file)) ;; init.el ends here -(put 'dired-find-alternate-file 'disabled nil) diff --git a/.emacs.d/rul-lisp/packages/rul-fm.el b/.emacs.d/rul-lisp/packages/rul-fm.el new file mode 100644 index 0000000..9abaffe --- /dev/null +++ b/.emacs.d/rul-lisp/packages/rul-fm.el @@ -0,0 +1,34 @@ +;;; rul-fm.el --- File management + +;; dired +(add-hook 'dired-mode-hook #'dired-hide-details-mode) +(setq dired-guess-shell-alist-user + '(("\\.\\(png\\|jpe?g\\|tiff\\)" "feh" "xdg-open") + ("\\.\\(mp[34]\\|m4a\\|ogg\\|flac\\|webm\\|mkv\\)" "mpv" "xdg-open") + (".*" "xdg-open"))) + +(setq dired-kill-when-opening-new-dired-buffer t) +(put 'dired-find-alternate-file 'disabled nil) + +;; dired-preview +(use-package dired-preview + :ensure t + :config + + (setq dired-preview-delay 0.5) + (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\\)")) + + (dired-preview-global-mode 1)) + +;;; Icons +(use-package nerd-icons :ensure t ) +(use-package nerd-icons-dired :ensure t + :config + (add-hook 'dired-mode-hook #'nerd-icons-dired-mode)) + +(provide 'rul-fm) -- cgit v1.2.3