HeadlinesBriefing favicon HeadlinesBriefing.com

Emacs Dired: A Powerful File Manager

Hacker News •
×

This article details the author's personal Emacs configuration for Dired, a powerful file browser that treats directories as Emacs buffers. The author explains how they transitioned from CLI tools like bash and zsh to Dired for its interactivity and enhanced features, such as image previews.

Dired is invoked through various keybindings, including C-x p d for project-specific directories and C-x C-j to open Dired in the current working directory. The author also utilizes C-x C-d, a rebind of the default C-x d, for opening local or remote directories via TRAMP.

File operations like copying, moving, and deleting are streamlined through marking files with keys like 'm' and 's'. The author highlights advanced marking techniques such as * . for marking by extension and % m for using regular expressions to select files. Files can also be "flagged" for deletion using d or % &, visually distinct from marked files.

A particularly powerful feature is WDired mode (accessed via C-x C-q), which makes the Dired buffer writable, allowing filenames to be edited directly using Emacs' text editing capabilities, including search and replace and macros.