79 lines
2.4 KiB
EmacsLisp
79 lines
2.4 KiB
EmacsLisp
;;; init-dired.el --- dired & dirvish -*-lexical-binding: t -*-
|
|
|
|
;;; Commentary:
|
|
|
|
;;; Code:
|
|
|
|
(setq dired-dwim-target t)
|
|
|
|
;; dirvish
|
|
(use-package dirvish
|
|
:hook
|
|
(dired-mode-hook . denote-dired-mode)
|
|
|
|
:init
|
|
(dirvish-override-dired-mode)
|
|
|
|
:config
|
|
(if *is-windows* (require 'fix-dirvish-preview))
|
|
|
|
(if *is-mac*
|
|
(setq dirvish-hide-details t)
|
|
(setq dirvish-hide-details '(dirvish-side)))
|
|
(setq dirvish-use-mode-line 'global)
|
|
|
|
(unless *is-windows*
|
|
(setq dirvish-attributes '(file-time file-size)))
|
|
|
|
(setq dirvish-default-layout '(1 0.15 0.45))
|
|
|
|
(with-eval-after-load 'dirvish
|
|
(add-hook 'dired-mode-hook #'dired-hide-details-mode))
|
|
|
|
:custom
|
|
(dirvish-quick-access-entries
|
|
(cond
|
|
(*is-windows*
|
|
'(("h" "~/" "Home")
|
|
("e" "~/.emacs.d/" "Emacs config")
|
|
("p" "c:/Users/gaozh/Pictures/Screenshots/" "Pictures")
|
|
("d" "f:/下载25-2-10/" "Download")
|
|
("v" "f:/luping26-1-11/" "Videos")
|
|
("n" "h:/emacs/my-org-note/" "Notes")))
|
|
|
|
(*is-mac*
|
|
'(("h" "~/" "Home")
|
|
("e" "~/.emacs.d/" "Emacs config")
|
|
("p" "~/Pictures/" "Pictures")
|
|
("d" "~/Downloads/" "Download")
|
|
("v" "~/Movies/" "Videos")
|
|
("n" "~/org/my-org-note/" "Notes")
|
|
("g" "~/gptel/" "gptel sessions")))
|
|
|
|
(*is-linux*
|
|
'(("h" "~/" "Home")
|
|
("e" "~/.emacs.d/" "Emacs config")
|
|
("s" "~/.config/guix/" "System config")
|
|
("p" "~/Pictures/" "Pictures")
|
|
("d" "~/downloads/" "Downloads")
|
|
("v" "~/视频/" "Videos")
|
|
("n" "~/org/my-org-note/" "Notes")
|
|
("g" "~/gptel/" "gptel sessions")))
|
|
(t nil))))
|
|
|
|
(use-package trashed
|
|
:commands (trashed)
|
|
:config
|
|
(setq trashed-action-confirmer 'y-or-n-p)
|
|
(setq trashed-use-header-line t)
|
|
(setq trashed-sort-key '("Date deleted" . t))
|
|
(setq trashed-date-format "%Y-%m-%d %H:%M:%S"))
|
|
|
|
(setq dired-listing-switches
|
|
"-l --almost-all --human-readable --group-directories-first --no-group")
|
|
(put 'dired-find-alternate-file 'disabled nil)
|
|
|
|
(provide 'init-dired)
|
|
|
|
;;; init-dired.el ends here
|