Exploring the Depths of Dired

Updates

Let’s dive into Dired!

Dired is truly one of the great features of Emacs, but it can be hard to adopt at first because the interface is pretty bland and unhelpful.

However, I believe that this package is worth learning deeply because it can make many file and directory operations much more efficient!

Today we’re going to dive to the depths of Dired via the manual and the information we can find in the functions and variables it provides in Emacs.

We won’t cover visual customization specifically, this is more about Dired functionality!

https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html

Things to try:

  • File marking, especially using patterns
  • dired-jump
  • Image thumbnails
  • Cleaning up folders with ~
  • Running shell commands on files
  • Comparing files between directories
  • Bulk file content changes with Q (query-replace-regexp)
  • Using wdired mode
  • Investigating dired-x

Any other suggestions?

Notes

(setq dired-dwim-target t) to automatically pick the right target for copy/move operations based on another open Dired window.

Interesting bindings under %:

% &             dired-flag-garbage-files
% C             dired-do-copy-regexp
% R             dired-do-rename-regexp
% d             dired-flag-files-regexp
% g             dired-mark-files-containing-regexp
% m             dired-mark-files-regexp
% r             dired-do-rename-regexp

Renaming files with a regular expression:

C-x C-q then C-M-%, enter a regular expression like \(.*\)-\([[:digit:]]\{4\}\) → \2-\1

How does Dirvish work?

Dirvish is a really elaborate package that builds on Dired to provide a polished experience! How do they do it?

https://github.com/alexluigit/dirvish

订阅系统工匠通讯!
与最新的系统工匠新闻和更新保持同步! 阅读 Newsletter 浏览更多信息。
名称 (optional)
邮箱