Emacs tip: Prevent too many buffers in Dired

1 min read · Posted on: Dec 4, 2009 · Print this page

This is for the users of the Emacs editor

Dired mode is the default way of visiting directories on Emacs. Whenever you open a file using C-x C-f, you would see the current directory. If you chose to press Enter without entering a file name, you would visit the current directory in Dired mode.

I don’t use the Dired mode very much to browse directories. I would rather use Windows explorer or Nautilus. Don’t get me wrong, I do find Dired extremely useful to locate a file. But for every directory you visit it adds a new buffer. This quickly becomes very unmanageable.

However, I recently found out that you can make Dired re-use the same buffer if you press a (dired-find-alternate-file) rather than ‘Enter’ for visiting a directory in Dired mode. This is can be even used to open a file which results in the last Dired buffer being completely removed (alternatively you can use v or dired-view-file to view a read-only version of the file).

With this tip, I am finding myself using Emacs more for browsing around my file system.


Arun Ravindran profile pic

Arun Ravindran

Arun is the author of "Django Design Patterns and Best Practices". Works as a Product Manager at Google. Avid open source enthusiast. Keen on Python. Loves to help people learn technology. Find out more about Arun on the about page.

Don't miss any future posts!

Comments →

Next: ▶   Managing Creative Assets - 1

Prev: ◀   Top 7 Inexpensive but Indispensible Things

Up: ▲   Blog

Featured Posts

Frequent Tags

banner ad for Django book

Comments

powered by Disqus