4

Simple question from a new Emacs user: I'd like to have my editing window have a sidebar (or a divided window, or a frame--I'm not sure of the terminology or the options here) that has a dired (or something else--any kind of interactive directory listing) in it.

The Emacs manual has complicated instructions for setting up top, bottom, or side frames, and I haven't been able to find a simple blog post or something that says, "This is what to do."

Basically I'd like my Emacs to look more like an IDE and less like an antique terminal window.

user9219182
  • 143
  • 3
  • 2
    You might want to try `M-x speedbar`, which will provide you with a tree view of files. –  Jan 22 '18 at 15:41
  • Related: https://emacs.stackexchange.com/questions/474/using-emacs-as-a-full-featured-c-c-ide/526#526 – Tobias Jan 22 '18 at 19:06
  • check out minimap mode: https://www.emacswiki.org/emacs/MiniMap – yemino Jan 24 '18 at 15:39

2 Answers2

4

M-x speedbar will open a new frame that contains a list of files in the same directory as the file you are editing. Clicking on a file name will open it in the other frame.

If you would prefer to get a file list in a different window in the same frame, you can install neotree.

I had a similar desire when I started using Emacs, and I recall there were a few more options, but those are the ones I liked the most. Since this is Emacs, you can customize any of them to work the way you want (assuming you have enough time on your hands).

benzado
  • 156
  • 3
  • Thanks for this reply, speedbar is great. If you add `(global-set-key [f5] (quote speedbar-get-focus))` to your `~/.emacs` file, you can then focus on the directory tree (or back on your current buffer) just by pressing the f5 key, so, no need to use the mouse. I was looking for something similar to NERDTree on vim, and speedbar fits the bill. – John Smith Optional Jun 15 '23 at 14:26
1

Something that says, "This is what to do."


Disclaimer: I'm likely the only person who does this (but since you asked...).

I open Dired in its own frame. I use dired-hide-details-mode, to hide the details by default, showing only the file names.

Actually, I use library dired+.el, which offers a little more in this area.

And I use libraries auto-fit-frame.el and fit-frame.el, so that the frame is shrink-wrapped onto the buffer content, not wasting any horizontal blank space.

You can position that Dired frame anywhere you like and leave it there, if you want.

But I also use library thumb-frm.el to thumbify it into a thumbnail frame on my desktop. C-z toggles thumbifying and dethumbifying (restoring to full size).

And I use library zoom-frm.el to be able to zoom in or out, shrinking or expanding the frame and its text, when I want it to take up more or less space. I usually use the Control key with the mouse wheel for that, but sometimes I use S-mouse-1 and C-S-mouse-1 instead to zoom in/out.

I do likewise with other buffers - open them by default in their own frames. For that I use library oneonone.el.

All of those libraries are on Emacs Wiki in the Elisp Area.

Drew
  • 75,699
  • 9
  • 109
  • 225