Files
.emacs.d/lisp/init-dired.el
Andsy10 4024ded7c6 feat(android): Add Android platform support
Configure dirvish, org, and package loading for Android: - Use
shared storage paths for org notes on Android - Adjust dirvish
layout and hide details for smaller screens - Disable async package on Android due to compatibility
2026-05-19 21:47:30 +08:00

94 lines
2.8 KiB
EmacsLisp

;;; init-dired.el --- dired & dirvish -*-lexical-binding: t -*-
;;; Commentary:
;;; Code:
(setq dired-dwim-target t)
(use-package dired
:straight nil
:config
(when *is-mac*
(setq insert-directory-program "gls")
(setq dired-use-ls-dired 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 (or *is-mac* *is-android*)
(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)))
(if *is-android*
(setq dirvish-default-layout '(1 0.6))
(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")))
(*is-android*
'(("h" "~/" "Home")
("e" "~/.emacs.d" "Emacs")
("n" "~/storage/shared/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