11

I am working on several projects right now. I want a single instance of Emacs to handle them all. What I want is a tmux-like behavior wherein every 'window' (in the Emacs sense) corresponds to a projects which contains buffers of the files related to that project. There are several windows, with each corresponding to a project and I should be able to switch between them (something similar to C-b w)

Is this functionality already present in some form? I guess it'll be cool to have as the other options are either:

  • Have several instances of Emacs open.
  • Have all files of all projects in a single instance which makes switching buffers a pain.
6
  • 2
    For project management, have you tried perspective?
    – cutejumper
    Mar 1, 2016 at 18:42
  • Try this blog post on Emacs as an advanced terminal multiplexer: you'll get Tmux-like behaviour. I just stumbled upon it, put it to work and it does what it advertises. On top you'll get ace-jump-mode, in itself a cool solution for quickly jumping around with your cursor in a buffer (if you don't already have it).
    – user6638
    Mar 2, 2016 at 0:28
  • If you are willing to invest some initial setup time to define conditions for projects, you can allocate them to one frame each and use frame-bufs. See also How to intercept a file before it opens and decide which frame -- stackoverflow.com/questions/18346785/… -- to display a buffer in a target frame, and you can use frame-buffs--add-buffer in conjunction to get the frame associated. You can marry frame-bufs with tabbar and associate/remove buffers dynamically: emacs.stackexchange.com/a/10112/2287
    – lawlist
    Mar 2, 2016 at 1:42
  • Here is the link to frame-bufs to associate buffers with a particular frame: github.com/alpaker/Frame-Bufs/blob/master/frame-bufs.el
    – lawlist
    Mar 2, 2016 at 1:50
  • @cutejumper Perspective is perfect. You could write it as an answer so that I could tick it correct. Mar 2, 2016 at 14:17

4 Answers 4

7

You can use perspective to manage projects. From its README:

perspective.el provides multiple workspaces (or "perspectives") for each Emacs frame. This makes it easy to work on many separate projects without getting lost in all the buffers.

Each perspective is composed of a window configuration and a set of buffers. Switching to a perspective activates its window configuration, and when in a perspective only its buffers are available by default.

There is also another version persp-mode, which is a little different from the original one. The perspectives are shared among frames and the states can be saved to the disk.

If you're using projectile, there is also a perspective integration.

5

You can try eyebrowse mode, which manages multiple (perhaps complicated) window layouts. You can switch between window configurations with keystrokes such as C-c C-w 1 and C-c C-w 2.

1
  • 1
    Eyebrowse shares buffer between workspaces. That might be undesirable Mar 7, 2016 at 17:01
2

A "barebones" solution might to use C-x r w to record the current window state and C-x r j to get back to an earlier one.

2

I use a combination of a couple different packages.

Most importantly, I use Projectile for working on a "project" and fuzzy-finding files. I use multiple frames, one for each project I'm currently working on. You really only need to know C-x 5 2 and C-x 5 0 to create/kill a frame. To manage switching between projects and for storing the state of window configuration/splits, I use Workgroups for windows (for emacs).

I like this setup because I can potentially swap out one package for another.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.