;;; dired-conf.el --- Configurations related to dired -*- lexical-binding: t; -*- ;; Copyright (C) 2021 李俊緯 ;; Author: 李俊緯 ;; Keywords: data, files, hardware, unix ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as ;; published by the Free Software Foundation, either version 3 of the ;; License, or (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see ;; . ;;; Commentary: ;; This file configures dired and related packages, including ;; trashed.el. ;;; Code: ;;; normal settings (require 'dired) (require 'dired-x) (require 'files) (set 'insert-directory-program "gls") (set 'dired-listing-switches "-alh --dired --group-directories-first --time-style=long-iso") (setq dired-dwim-target t) (add-hook 'dired-mode-hook #'hl-line-mode) (require 'rx) (setq dired-garbage-files-regexp (rx (or "aux" "bak" "dvi" "log" "orig" "rej" "toc" "out" "nav" "snm") eos)) (require 'dired-aux) (setq dired-isearch-filenames 'dwim) (setq dired-create-destination-dirs 'ask) (setq dired-vc-rename-file t) (require 'wdired) (setq wdired-allow-to-change-permissions t) (setq wdired-create-parent-directories t) (define-key wdired-mode-map (vector 'return) #'wdired-finish-edit) (require 'image-dired) (setq image-dired-external-viewer "open") ;;; trash settings ;; I tried the package trashed, but it does not support the trash can ;; on macOS. (set 'delete-by-moving-to-trash nil) (set 'trash-directory "/Users/durand/.Trash/") (provide 'dired-conf) ;;; dired-conf.el ends here