Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs buffer groups / tabs

Tags:

emacs

I am always working on multiple code bases at the same time. Usually an internal library, a web app and some service.

Is there a way with Emacs to have multiple buffers open for each code base but have those buffers grouped? Like a tab for each code base or groups I can easily switch between.

I've checked out tabbar-mode which isn't what I'm looking for. I'm looking for an easy way to quickly switch from working on one code base to another. Like saving a set of windows for each project and quickly switching between them.

Any ideas?

like image 756
jpoz Avatar asked Apr 02 '12 07:04

jpoz


2 Answers

A few suggestions:

  1. ibuffer is an advanced replacement for list-buffers which you can bind to C-xC-b in its place. This lets you filter the buffer list by various criteria, combine filters into groups, and arrange the groups however you wish; you can also save your filters and groups to restore later. Use C-hm from the ibuffer buffer to see all the options. See also: Emacs: help me understand file/buffer management

  2. Try one of the various screen-like libraries for Emacs, such as Elscreen or Escreen. I've never gotten around to trying them out myself, but I gather that you can have separate buffer lists per screen, which seems like it would suit your purposes.

  3. If you want even greater separation, such that when one project is 'active' the buffer from the other(s) are unavailable, then I don't know of a way of doing that in a single instance of Emacs, but in that situation I would simply start multiple instances of Emacs; one for each project. Emacs is sufficiently lightweight on modern hardware that this is an entirely reasonable approach.

like image 196
phils Avatar answered Nov 11 '22 21:11

phils


Have a look at projectile - a simple and unobtrusive project management lib for Emacs. One of its features is exactly switching to buffers from a specific project (C-c p b).

like image 24
Bozhidar Batsov Avatar answered Nov 11 '22 23:11

Bozhidar Batsov