3 (setq dired-dwim-target t
4 dired-listing-switches
"-alh"
5 ls-lisp-use-insert-directory-program nil
)
7 ;; easily diff 2 marked files
8 ;; https://oremacs.com/2017/03/18/dired-ediff/
9 (defun dired-ediff-files ()
12 (defvar ediff-after-quit-hook-internal
)
13 (let ((files (dired-get-marked-files))
14 (wnd (current-window-configuration)))
15 (if (<= (length files
) 2)
16 (let ((file1 (car files
))
17 (file2 (if (cdr files
)
21 (dired-dwim-target-directory)))))
22 (if (file-newer-than-file-p file1 file2
)
23 (ediff-files file2 file1
)
24 (ediff-files file1 file2
))
25 (add-hook 'ediff-after-quit-hook-internal
27 (setq ediff-after-quit-hook-internal nil
)
28 (set-window-configuration wnd
))))
29 (error "no more than 2 files should be marked"))))
32 (setq dired-guess-shell-alist-user
33 '(("\\.pdf\\'" "evince" "zathura" "okular")
34 ("\\.doc\\'" "libreoffice")
35 ("\\.docx\\'" "libreoffice")
36 ("\\.ppt\\'" "libreoffice")
37 ("\\.pptx\\'" "libreoffice")
38 ("\\.xls\\'" "libreoffice")
39 ("\\.xlsx\\'" "libreoffice")
40 ("\\.flac\\'" "mpv")))
41 :bind
(:map dired-mode-map
42 ("b" . dired-up-directory
)
43 ("E" . dired-ediff-files
)
44 ("e" . dired-toggle-read-only
)
45 ("\\" . dired-hide-details-mode
)
48 (b/dired-start-process
"zathura"))))
49 :hook
(dired-mode . dired-hide-details-mode
))
51 (provide 'bandali-dired
)