7

Is there some mode where emacs fixes a small window with a list of opened buffers? This is what simpler editors have (kate,gedit,etc).

Here's an example from Kate:

enter image description here

In the left window there is a list of opened files. This is rather independent from the main editing window, while being connected. Some examples: I can maximize the whole set, it doesn't disappear if I split/unsplit the main editing windows.

(Edited for clarity)

Fernando César
  • 233
  • 2
  • 5

3 Answers3

8

M-x speedbar and typing b (buffer display mode). This gives you a narrow dedicated frame with the required information.

Dieter.Wilhelm
  • 1,836
  • 14
  • 25
3

To include the speedbar in the main frame, use the sr-speedbar library - M-x package-list-packages, look for sr-speedbar, then hit i then x to install it.

To turn it on and off, call sr-speedbar-toggle - then you can bind it to a convenient key in your .emacs file, e.g.

(global-set-key (kbd "M-1") 'sr-speedbar-toggle)

With a little tweaking you can get it over on the left side of the screen and looking a little nicer. Try M-x customize-apropos sr-speedbar and M-x customize-apropos speedbar to set various options.

There's a bit more info on the Emacs Wiki - http://www.emacswiki.org/emacs/SrSpeedbar.

It would be great if these libraries could be merged and included in Emacs someday.

Brian Burns
  • 1,577
  • 14
  • 15
  • I do like sr-speedbar, just what I was looking for, just one little nit. I wish when I select the buffer and hit enter the window would go away, like sr-speedbar-close was called. Could I do this with defadvise or something? – jtgd Apr 23 '16 at 07:37
  • Nevermind, got it: (advice-add 'speedbar-edit-line :after #'sr-speedbar-close) – jtgd Apr 23 '16 at 07:42
2

The command to open the list of buffers that you want is list-buffers. It is bound to C-x C-b by default.

Put this in your init file, or use M-x customize-option RET special-display-buffer-names to customize the variable to include an entry for buffer *Buffer List*:

(add-to-list 'special-display-buffer-names "*Buffer List*")

Then the buffer list will be in its own, dedicated frame.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • Yes, I know `list-buffers`, but is not really adapted to a small column. By your answer I guess what I was thinking doesn't exits. – Fernando César Oct 17 '15 at 21:01
  • 1
    Then your question is unclear. In particular it is unclear what you mean by "*I can ... open a buffer list ....*" Please *show your code* (what you've tried), what you expect/want, and how what you have tried so far differs from that. Also, presumably you do not mean "*opened buffers*" in your title and description, but rather a "*list of names of* opened buffers". If so, please edit to make this clear. – Drew Oct 17 '15 at 22:28
  • 1
    Hy @Drew. I edited the question. I hope it's more clear what I was asking. I'm not developing anything, I was just asking if emacs has an option I see often in other editors. – Fernando César Oct 18 '15 at 07:41