Emacs tip: Prevent too many buffers in Dired

2009 December 4
by Arun Bhai

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.

Distantly Related posts:

  1. Emacs Tip: A Key to open the Current Folder in Windows
  2. 5 Indispensable Tips for Emacs on Windows
  3. Happy Organised 2008
  4. Is Python Intellisense Possible in Emacs?

4 Tweets

2 Responses leave one →

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

Additional comments powered by BackType