2

I've been using emacs for quite a few years and (like many people), I haven't quite perfected the art of using it yet. One stumbling block I noticed is that when I have several buffers I'm working on, I waste time recalling one buffer name or another as I switch around.

I also use a laptop for much of my work, so this is probably more of an issue than it would be if I had a larger screen with more windows.

I've tried ECB and it's kindof comforting to have a list of files and a directory tree visible, but ultmately, by the time I scroll move my hand to the touchpad and scroll around for the file, I've spent about the same amount time as I would've if I typed in the buffer name in. It ends up just taking up valuable screen real estate.

Does anyone have a good system/tricks for cutting down on time-wasted switching around emacs buffers like this?

1
  • Besides using iswithb or a similar package I also recommend assigning buffer switching to a single key. Buffer switching is a very freuqent operation, so it makes no sense to press 3 keys (C-x b) to activate it. Assign it some otherwise useless key like the INSERT key which is rarely used otherwise (who needs to switch to overwrite mode? and if sometime you do then you can use M-X overwrite-mode instead of wasting a good key for that). Other possible candidates are CapsLock, Right Control, etc, though you may need some help from your OS to bind those in emacs)
    – Tom
    Aug 28, 2011 at 18:51

8 Answers 8

4

Try iswitchb-mode. It's part of emacs and adds more advanced search features to C-x b.

0
1

Check out the different buffer switching methods on EmacsWiki.

I recommend iswitchb. You can type any part of the buffer name, so you can get to any buffer by typing a few characters only. Combine this with uniquify for even better results.

1

iswitchb is a great replacement for C-x b. Personally, even thinking of buffer-names is distracting to my workflow. I find it a lot quicker to manage the buffer-list as an MRU (most recently used) stack. Look at buffer-stack and buffer-stack-suppl here emacswiki. This is what alt-tab in Windows does. f10 is the equivalent of bubbling within the same major-mode. S-f10 bubbles amongst all buffers.

2
  • If you have lots of buffers open (and you should, because closing and opening files is time consuming) then walking the buffer list sequentially is very inefficient. Iswitchb does it much better.
    – Tom
    Aug 29, 2011 at 9:52
  • Workflows are subjective. The magic here is that it's not just any sequential order. The buffer list is always in MRU order, which is especially useful because I have a lot of files open.
    – event_jr
    Aug 31, 2011 at 5:14
0

C-x C-b.

These old text editors have surprisingly good documentation.

1
  • i'm aware of C-x C-b.
    – qb4
    Aug 28, 2011 at 17:46
0

Try David Ponce's swbuff.el. It's not in part of emacs, but first hit in google seems to work. Bind it to key strokes with e.g.

(global-set-key [(meta left)]   'swbuff-switch-to-next-buffer)
(global-set-key [(meta right)]   'swbuff-switch-to-previous-buffer)
0

Try speedbar. It's part of emacs. (It probably use as much screen real estate as ECB, and thus not a valid answer to you.)

1
  • 1
    maybe there's some advanced functionality to make it useful, but I wasn't a huge fan. The floating frame is also kindof a pain to arrange on the screen (using osx atm). Is there something about speedbar that makes it worthwhile, or is it basically just a file browser?
    – qb4
    Aug 30, 2011 at 2:38
0

You might want to try tabbar-mode. tabbar-mode puts a series of tabs (like in a browser, not like tab-stops) along the top of your emacs editing window. You can select which buffer you want by clicking on the appropriate tab. (This actually simulates the default behavior of XEmacs.)

I have only played a little bit with tabbar-mode as its tab display gets written over by StickyFunc-mode.

0

Try Vertico. If you need more power, try adding Orderless.

With those two packages, I can almost always select the buffer I want by typing just two characters from the name - often even just one is enough. I don't think I've typed a full buffer name or even close to it ever since I installed them about a year ago.

If you want to reduce external dependencies, Vertico can be mostly replaced with icomplete-vertical-mode (or icomplete-mode, if you don't like your minibuffer completion candidates displayed vertically); and you don't need Orderless, it just gives you more flexibility in selecting what you want with less typing and less need to edit/navigate what you already typed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .