reddit / emacs
Any tips to manage different projects while retaining split layout?
maxle0312 · 2022-06-06 09:32
I jump around projects using projectile. This is nice to jump around but it doesnt preserve splits layout. Say I have 2 projects: A and B. For A, I do a 3 way splits: 2 for source codes and 1 for compilation window. For B, I have a vertical split with a text file on the left, and a PDF on the right. How do I move back and forth between A and B, and not messing up the layout? Projectile as I said, works fine but then I need to resplit the windows to my taste.
I have tried "desktop.el". So you save to a .desktop file, but the downsides are: you need to remember to change to the "desktop-dir" to have the layouts loaded, and it doesnt keep the positions in a PDF file.
paretoOptimalDev · 2022-06-06 11:07
Burly or registers? save-place mode for PDF position maybe?
pathemata · 2022-06-06 11:40
I second `burly`. With `consult-buffer` bookmarks narrowing you can switch very quickly between layouts.
catern · 2022-06-06 11:41
I cannot say this loudly enough: tabs in Emacs 28, under the C-x t prefix. This is exactly what they are for.
aisamu · 2022-06-06 11:55
Doom achieves this via [persp-mode](https://github.com/Bad-ptr/persp-mode.el).
When you switch to a project with `SPC p p`, you're also switching to a perspective exclusive to that project, which is saved between restarts.
You can also create new perspectives with `SPC TAB n` (those aren't connected to a particular project)
Imaltont · 2022-06-06 12:07
Tabs existed before 28 too, they got integrated in 27 afaik. Great feature.
maxle0312 · 2022-06-06 12:36
Thank you so much for suggesting burly ! Nice thing about it is i can just toggle my bookmark list, press Enter on the burly bookmark and voila: all splits are saved AND pdf location is also saved.
mclearc · 2022-06-06 13:07
I use tab-bar and project (both built in) to do this. I have a package that adds some useful functionality to this as well, including buffer isolation within different tabs. Maybe you’ll find it useful.
https://github.com/mclear-tools/tabspaces
jimehgeek · 2022-06-06 14:29
I have commented about various setups for this kind of thing a few times in the past:
- https://reddit.com/r/emacs/comments/ualg7r/_/i5zsmgh/?context=1
- https://reddit.com/r/emacs/comments/mppfy3/_/gubhe64/?context=1
- https://reddit.com/r/emacs/comments/j5bm4x/_/g7usm6s/?context=1
What you basically want is something that lets you quickly switch between different window configurations, and there’s a number of packages that lets you do this, including the built-in `tab-bar-mode` since Emacs 27.x.
trae · 2022-06-06 15:11
Thanks for pointing this out. Good overview [here](https://mmk2410.org/2022/02/11/using-emacs-tab-bar-mode/).
> But there is also tab-bar-mode which works a little bit different: instead of having one file per tab you have one window configuration per tab.
big_lentil · 2022-06-06 16:22
You can also just use multiple emacs frames (C-x 5 2)
I generally use emacs with a lot of frames, spread across multiple desktop environment workspaces and grouped by purpose.
JohnathanDee · 2022-06-06 16:23
Burly is great! I use it for my D&D character sheets where I split the frame into 12 windows with sections like "Inventory" narrowed.
jkdufair · 2022-06-06 16:28
Indeed I use `projectile` and `perspective` and connect them via `persp-projectile` to achieve just this. Edit: Vanilla Emacs, not Doom, myself
mysticynical · 2022-06-06 16:49
Look into using [perspective](https://github.com/nex3/perspective-el)
MotherCanada · 2022-06-06 17:05
Anyone know if there was a reason why it was called tab-bar-mode instead of something like workspace-mode?
ajgrf · 2022-06-06 22:42
Probably because there were already a bunch of Emacs packages implementing workspaces, and the missing piece that needed to be implemented in Emacs core was the actual tab bar UI element.
carnivorousdrew · 2022-06-06 23:18
I just found them out the other day after not knowing at all lol it really is a game changer, still getting used to the workflow.
carnivorousdrew · 2022-06-06 23:39
this looks pretty neat-o. So it basically filters the list of buffers to the ones relevant to a tab space, correct?
__karlota__ · 2022-06-07 00:05
https://depp.brause.cc/eyebrowse/
Available-Bug8339 · 2022-06-07 00:30
Unpopular opinion: tmux sessions + terminal emacs.
mclearc · 2022-06-07 00:35
Yes - exactly. There are also a few other helper functions to make working with tabs and projects a bit easier. It’s not as full featured as something like projectile but sometimes simpler is better.
redguardtoo · 2022-06-07 00:53
https://github.com/pashinin/workgroups2
This program can save&load multiple named workspaces (or “workgroups”),
Save all opened buffers, their location and sizes on disk to restore later
Restore special buffers as: org-agenda, shell, magit-status, help, pdf-tools
Users can set up to support any special buffer (restoring the page number and notes of pdf file, for example)
moxxon · 2022-06-07 10:07
Window management is probably the only thing I really struggle with in Emacs.
It feels like I'm have no control. New windows pop up instead of using existing splits etc.
I'm not jealous of typical ide layout, they feel too rigid, but with Emacs I feel like it's too loose and sloppy.
Hasnt stopped me from using it but man...
by_wicker · 2022-06-07 10:26
Unpopular opinion or random orthogonal interjection?
Available-Bug8339 · 2022-06-07 15:44
I intended as the former.
paretoOptimalDev · 2022-06-07 17:01
Try these:
https://youtu.be/xRm5SUf68pc
https://youtu.be/-H2nU0rsUMY
https://youtu.be/E-xUNlZi3rI
https://youtu.be/rjOhJMbA-q0
https://youtu.be/kyllrQiNsyA
moxxon · 2022-06-07 17:10
Will do ty.
big_lentil · 2022-06-07 19:20
Have you tried looking into display-buffer-alist?
moxxon · 2022-06-07 20:35
I actually don't know... It's been awhile since I tried organizing my windows. It's always been something I just lived with.
I'll take a look thanks!
maxle0312 · 2022-06-08 16:13
well I just had time to try out tabs for Emacs today.. and holy moly, it works !! Thanks so much for suggesting. Any tips to browse specific tab's buffers?