diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-26 10:16:12 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-26 10:16:12 -0400 |
| commit | 1320172999ca3dbe8cd1affaeafacad45df9ae76 (patch) | |
| tree | 9416a26b1ca37e1487bc2c7216856876cb93ea69 /modules | |
| parent | 2e1cdc287039a5e37dedc1bc8b6ad846dd659f00 (diff) | |
| download | dotemacs-1320172999ca3dbe8cd1affaeafacad45df9ae76.tar.gz dotemacs-1320172999ca3dbe8cd1affaeafacad45df9ae76.zip | |
feat(dirvish): make dired d=diff and D=delete to match the convention
dired's d was dired-flag-file-deletion and D was dired-do-delete, while the ediff diff sat on e. Bind d to the ediff diff and keep D as delete, so the d=diff / D=delete pair is consistent with C-; b and ibuffer. d no longer flags for deletion -- mark with m for batch deletes, then D. Fix the stale commentary (it called d "delete" and D "duplicate") and add which-key labels for the pair.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/dirvish-config.el | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/dirvish-config.el b/modules/dirvish-config.el index 81d352dbd..b82cdd0d7 100644 --- a/modules/dirvish-config.el +++ b/modules/dirvish-config.el @@ -17,8 +17,8 @@ ;; ediff, playlist creation, path copying, and external file manager integration. ;; ;; Key Bindings: -;; - d: Delete marked files (dired-do-delete) -;; - D: Duplicate file at point (adds "-copy" before extension) +;; - d: Diff/ediff selected files (cj/dired-ediff-files) +;; - D: Delete (dired-do-delete; mark with m for batches) ;; - g: Quick access menu (jump to predefined directories) ;; - G: Search with deadgrep in current directory ;; - f: Open system file manager in current directory @@ -194,7 +194,9 @@ Filters for audio files, prompts for the playlist name, and saves the resulting (:map dired-mode-map ([remap dired-summary] . which-key-show-major-mode) ("E" . wdired-change-to-wdired-mode) ;; edit names and properties in buffer - ("e" . cj/dired-ediff-files)) ;; ediff files + ("e" . cj/dired-ediff-files) ;; ediff files + ("d" . cj/dired-ediff-files) ;; d = diff, matching C-; b / ibuffer (was dired-flag-file-deletion) + ("D" . dired-do-delete)) ;; D = delete (d no longer flags; mark with m, then D) :custom (dired-use-ls-dired nil) ;; non GNU FreeBSD doesn't support a "--dired" switch :config @@ -205,6 +207,13 @@ Filters for audio files, prompts for the playlist name, and saves the resulting (setq dired-recursive-copies (quote always)) ;; "always" means no asking (setq dired-recursive-deletes (quote top))) ;; "top" means ask once +;; which-key labels for the d=diff / D=delete pair (shown in the major-mode +;; popup via `which-key-show-major-mode'). +(with-eval-after-load 'which-key + (which-key-add-major-mode-key-based-replacements 'dired-mode + "d" "diff (ediff files)" + "D" "delete file")) + ;; note: disabled as it prevents marking and moving files to another directory ;; (setq dired-kill-when-opening-new-dired-buffer t) ;; don't litter by leaving buffers when navigating directories |
