Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs sr-speedbar

Tags:

emacs

editor

I am currently trying to learn Emacs more in depth so that I can do more with my Emacs than just simple editing stuff... I am making good progress and at the moment I am trying to configure the 'sr-speedbar' module to my liking, but some details I can't figure out myself:

  • Say that I've 2 open buffer windows A and B plus the speedbar window. If I open a file by pressing Enter in the speedbar window, then the new file always get opened in the same buffer window B (which I opened last). Can I somehow specify that the new content should be opened in buffer window A?
  • Currently the speedbar window refreshes itself automatically to the new location whenever I open a new file using 'C-x C-f'. This is actually pretty useful, but sometimes I don't want this when I am quickly trying things out in a tmp file. And the refresh also "destroys" my "tree-view" of the speedbar, where I expanded the directory contents rather than opening them directly. The question is, how can I suppress this "refreshing behaviour"? Can I somehow disable the automatic mode and trigger it manually if I need it?

And do you guys have more useful tips regarding speedbar navigation? How does a Emacs guru use speedbar or are there better alternatives?

Thx in advance for your help!

like image 275
bmk Avatar asked Dec 08 '14 09:12

bmk


1 Answers

You can turn off the auto-refresh in your init file like this -

(require 'sr-speedbar)
(setq sr-speedbar-auto-refresh nil)

and/or turn it on and off later with the function sr-speedbar-refresh-toggle.

The defaults it (and speedbar) comes with are a bit odd though - it also doesn't show files that it doesn't recognize, uses images for buttons, and is set on the right side - so you can set these if you'd like -

(setq speedbar-show-unknown-files t) ; show all files
(setq speedbar-use-images nil) ; use text for buttons
(setq sr-speedbar-right-side nil) ; put on left side


I do use sr-speedbar for projects that have enough of a directory structure - otherwise I use the usual switch-to-buffer (C-x b), ibuffer (C-x C-b), and dired (C-x d), and another function that switches to the previous buffer. Also bound to single keys because they get used so much.

But... I'm still learning Emacs - I haven't tried helm, projectile, or project-explorer yet - they look interesting also.

like image 114
Brian Burns Avatar answered Sep 17 '22 06:09

Brian Burns