My Emacs Journey (1) - Dired

I’ve been reflecting to my previous failed attempts of using Emacs and wondering what could’ve been done differently.
So as usual I started jotting down notes related to how I felt and where my pain points were as if I were to go back in time and teach my past self.
I often do this to ensure I understand what I am doing and can transfer the knowledge and insights to someone else if needed.
Over months of discovering Emacs, I’ve accumulated a lot of tips and tricks on the features and packages of Emacs. And now I want to share them as blog posts.
Because I have so many notes, mostly unfinished/in-progress/unpolished, making a series of multiple posts out of them seems to make more sense.
It’ll give me the necessary time to review my notes and make some light editing on them before publishing.
So I’m going to share “My Emacs Journey” with you. I hope you’ll enjoy it!
The first note I’ve written is titled : “Start with Dired”
Why I recommend to start with Dired
Dired is the Emacs built-in file manager.
In my opinion, file management is the backbone of any productive workflow. Without a solid system for organizing and manipulating files, everything else feels a little off.
I was deep into Vim before Emacs.
My biggest mistake during that period was probably not using netrw
(:Ex
command) extensively.
For folder creation, what I did was either of the following:
- Put Vim in background and use linux commands.
- Split my terminal using tmux to keep Vim and the Shell side by side.
This constant context-switching broke my flow and left me feeling like something was missing.
I knew that robust file management was the missing piece but I didn’t put my mind into a solution until later on.
When I started using Emacs, I also made the same mistake. I was so excited about all the bells and whistle of Org-mode and other features that I neglected Dired!
My recommendation? Always start with Dired. It is the key for a more integrated experience with Emacs.
Mastering Dired will make everything else in Emacs feel more natural.
How to use Dired?
Assuming not everyone reading this post is familiar with Emacs (and might not even be a computer scientist), I will avoid relying heavily on Emacs’ non-conventional default keybindings as much as I can.
The simplest way to open Dired is by using M-x dired
command. (press Alt+x
, type dired
, and then hit <enter>
).
The shortcut for this is C-x d
(press Ctrl+x
, then d
).
From there, the essential commands are:
v
to quickly view the content of a file andq
to quit and returnC-o
to display the selected file in a split viewj
to jump into file directly. Very useful when having too much file in a folder^
to go to the parent directory (andq
to quit and return)g
to refresh the Dired view
With the basics, you can navigate pretty well through files and folder.
For more advanced commands:
m
mark on pointeru
orU
unmark or unmark all*.
mark by file extension**
mark all executable filesd
mark for deletionC
copy to a new name (or path)x
execute the actions on marked file
Some interesting command I’m using are:
k
to temporarily hide marked files from diredZ
to compress (tar.gz) or uncompress a file or a folder
Taking Dired further
Once you are familiar with the basic commands, you may want to explore some advanced features of Dired.
A favorite of mine is the &
command which opens files using specified external programs.
For example: &feh
to open an image file using the image viewer feh
.
If you are interested in digging deeper, I invite you to check the Dired manual.
What I like about Dired
If I were in a terminal environment, I would have to rely on other tools like Midnight Commander, Ranger etc… and learn to use them independently.
In Dired, I leverage what I’ve already learned in Emacs and apply it (keybindings, buffers, motions, etc).
No extra installations, no disruptions—just efficient file management. But that’s just the usual Emacs stuff!