My Emacs configuration (Dired)
My Emacs configuration (Dired)
A calendar icon
05 Jul 2026<br>A tag icon emacs it
This blog post is a part of the series of posts about my Emacs<br>configuration. Previous posts:
My Emacs configuration (common parts)
Why and how I ditched use-package?
Here I will be dedicated to the configuration, and my habits, and<br>usual actions during the Dired usage. I decided not to just describe<br>configuration and that's all — you could read a lot of likewise<br>blogposts already. Instead of it I also would like to describe how I<br>am using Dired every day.
Little explanation about Dired for readers, who didn't use it before.<br>It is a program for Emacs which works as a powerful file browser,<br>which treats your precious files and directories as an (almost) usual<br>Emacs buffer — so you can navigate through and work with you catalogs<br>using the same "emacs-habits".
Figure 1: Two Dired windows opened in the Emacs.
Preamble
Since, I tend to use a kinda minimalist environment for computing —<br>first, I used a CLI (bash then zsh) for the most of the operations<br>with files and catalogs. It works well, but I wanted to have some<br>interactivity — copy/move some files from one catalog to another<br>catalog without issuing multiple cp commands1, view contents of one<br>directory while browsing another catalogs, like in Midnight Commander,<br>etc.
Some time I used the mentioned mc and it went well. But I wanted<br>more — preview images, etc — and the Midnight Commander was unable to<br>help me with this, since it doesn't have plugins like Far. Yes, it has<br>a good menu, binded to F2 key, able to display various commands for<br>various file types. But it wasn't enough for me.
So, by the way, I decided to give Dired a try — since it is already<br>installed with almost every Emacs distribution. And things went so<br>well, that I'm staying with the Dired now.
Calling the Dired
Usually I'm invoking the Dired in two ways. First, if I'm working with<br>some project2, I press C-x p d hotkey and type some letters to<br>jump into the desired catalog inside the project.
E.g. if I work with my dotfiles and want to open directory configs I<br>type:
C-x p d configs
And fall into the desired catalog:
If I want just to open the root catalog of the project — I use C-x p D<br>keybinding instead.
Second, my beloved, method — the C-x C-j keybinding3. It opens<br>the Dired buffer in the current working directory. For example, if I<br>want to work with files for my blogpost, while I'm editing the post<br>itself — I just press C-x C-j and buffer with article's Org file and<br>images opens:
Figure 2: After C-x C-j press while editing the article.org file
Of course, there are some other methods to invoke the Dired, which I'm<br>using. For example the default C-x d keybinding, which I rebinded to<br>C-x C-d for convenience:
(keymap-global-set "C-x C-d" 'dired)
I'm using this keybinding most of the time, when I want just to open<br>some directory, local or remote (with the help of TRAMP). E.g. this is<br>how I could open bin catalog on the not so remote server<br>server.example.com with the username user account:
C-x C-d /ssh:username@server.example.com:~/bin<br>- After entering this colon, the GnuGP will ask me about my<br>password for private key, to decipher ~/.authinfo.gpg with<br>username's password for server.example.com.
Also, in my system the Emacs frame with Dired buffer could be opened<br>from any program which could open the file manager — e.g. after<br>downloading file in Librewolf, I could press the folder icon in the<br>"Downloads" drop-down menu and the Emacs frame with Dired buffer for<br>directory with my downloaded file will be opened:
I already described how to setup Emacs as a default file manager here:<br>Emacs Dired as a default file manager.
File operations
Usual file operations: copying, moving or removing sets of files — are<br>pretty simple. "Just" mark some files with m keybinding and copy/move<br>them (see the 32.7 Operating on Files in the Emacs Manual).
I placed just in the quotes, because there is not only m keybinding to<br>mark files. There are a lot of ways to do so — look at the 32.6 Dired<br>Marks vs. Flags section from Emacs manual. Most of the time I'm using<br>the next ways to mark some files:
Keybinding<br>Description
* s<br>Mark all files and catalogs
* .<br>Mark files with the specified extension
% m<br>Mark files with names matched by regexp
Remove all marks
Toggle marks
For example, I'm using * . to mark unwanted files by it's extension<br>and delete them. E.g. to delete all web-pee images: * . webp RET D y<br>RET. Neat thing: if cursor already on the line with WEBP image, then<br>the * . RET D y RET is enough, the webp part is preselected by<br>default.
By the way, these long "keybindings" are not real — there are two<br>separate keybindings (. * and D), my answer for the prompt about file<br>extension to select, and answer for the file deletion confirmation.
Or another example: if I want to convert all WEBP images to the JPG (I<br>dislike WEBP as a corporate image format, to be honest), then I'll...