reddit / emacs
Workspaces in Emacs
pudentia · 2022-08-26 17:08
A feature I love in both Sublime Text and VS Code is workplaces. Besides Projectile, what in Emacs would come closest to recreating this experience of multiple workspaces for me?
kkvi115 · 2022-08-26 17:12
Would be a lot easier if you specify what you want as there are lot of ppl like me only uses Emacs, so I don’t know what you are missing….
pudentia · 2022-08-26 17:23
It is hard to describe unless you have worked with it. It is basically arranging sets of files into categories and working with them. For example, I have a Python workspace, a diary workspace, a notes workspace, etc.
ForkInBrain · 2022-08-26 17:43
I’m not aware of any package that claims to give you workspaces as they work in VS Code.
Projectile is the big name in town here, but emacs has recently added some idea of what a project is natively (project.el).
Try those out and see what you find to be missing? That might help you with describing what you’d like. I find emacs puts more of the burden on you to come up with how you want to work, whereas most other programs tell you how to work and you either like it or you don’t. The latter approach is fine for many people, but it often means those people don’t quite know what or why they like the program (from a feature standpoint), they just like it.
pudentia · 2022-08-26 17:45
That's helpful, thanks for your response.
timmymayes · 2022-08-26 17:52
Maybe the build in desktop save mode and Frame Registers.
Frame registers will save window state and frame state. Desktop save mode will save those layouts.
I use projectile still but I'm starting to like the frame registers, window registers and bookmark system built into emacs quite a bit.
TehVagiants · 2022-08-26 17:53
You could try [perspective](https://github.com/nex3/perspective-el) or [persp-mode](https://github.com/Bad-ptr/persp-mode.el)
pudentia · 2022-08-26 18:04
I will def. give these a try. Thanks.
_viz_ · 2022-08-26 18:11
C-h P filesets RET
thetemp_ · 2022-08-26 18:21
I don't have any idea what those editors provide as "workspaces". But there are many packages that could be (or are) called that for Emacs.
A few that provide some relevant functionality are listed below.
* project.el -built-in- provides project features, FWIU, it's a subset of what Projectile offers.
* desktop.el -built-in- Allows for saving and recalling state of windows, tabs, buffers and more between sessions, either automatically or on demand.
* tab-bar.el -built-in- Lets you maintains different window configurations, which are optionally accessible via tabs at the top of the frame. To use without displaying tabs, simply load the library without enabling `tab-bar-mode` and use the included commands to switch between "tabs". There is probably a way to use completion to switch between the tab-bar's "tabs" when they're not visible. But I don't keep very many open. So I just use "M-3" to switch to tab 3 for example. That requires setting `tab-bar-select-tab-modifiers`.
* tab-line.el -built-in- Maintains a list of buffers opened per-window. With `tab-line-mode` enabled, it also displays tabs at the tops of windows for switching among the buffers. As with tab-bar.el, display of tabs is optional. However, using completion with the buffer lists may require [some additional configuration](https://www.reddit.com/r/emacs/comments/wfs28b/tabline_buffers_source_to_consult/). The linked snippet is for getting `consult-buffer` to use the buffer lists.
I'm currently using the above built-in packages plus the linked snippet, and I'm happy with it. But I'm also not very picky when it comes to this. I just want to be able to focus on one thing at a time and have quick access to buffers that are relevant to what I'm working on.
Here are some external packages you might be interested in.
* perspective.el - Workspaces specific to frames.
* persp-mode.el - Fork of above, with workspaces shared among all frames, among other differences.
* tabspaces - Uses the built-in tab-bar.el and project.el to provide workspaces accessible via tab-bar tabs.
* workgroups - Old package for saving window configurations (used by persp-mode)
* workgroups2 - Currently maintained fork of above, can restore "special buffers", like `org-agenda`.
* bufler - "Group buffers into workspaces with programmable rules, and easily switch to and manipulate them."
* burly - Save frame and window configurations using Emacs's bookmarks system.
grimscythe_ · 2022-08-26 18:36
Maybe the eyebrowse package?
pudentia · 2022-08-26 19:56
Super helpful reply. Thank you. I will carefully investigate your proposals.
paretoOptimalDev · 2022-08-26 20:42
- https://github.com/mclear-tools/tabspaces
- consult integration
- restore with https://github.com/alphapapa/burly.el
Well don't have restore working yet, but this is a "close to vanilla" set of packages.
00-11 · 2022-08-26 22:55
If you use [Bookmark+](https://www.emacswiki.org/emacs/BookmarkPlus) then you can bookmark a desktop state - the open files, directories, windows, frames, sets of variables - whatever state `desktop.el` can save. You can have any number of [desktop bookmarks](https://www.emacswiki.org/emacs/BookmarkPlus#DesktopBookmarks). Jump between them as you would jump to any bookmark.
----
You can also [bookmark mark a bookmark file](https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkFileBookmarks), as a collection of bookmarks - jump to it to restore all and only bookmarks relevant to a particular project.
----
How to flag a bookmark as pertaining to a particular project or set of projects? Use [tags](https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkTags).
----
You can also bookmark a [bookmark-listing state](BookmarkListBookmarks, which can show a particular set of bookmarks (e.g. those with a particular set of tag matches), in a particular order,...
----
You can also bookmark Dired(DiredBookmarks) buffers (saving and restoring their `ls` switches, markings, hidden files, inserted subdirs, etc.).
microamplifier · 2022-08-27 00:30
A happy eyebrowse user here.
https://depp.brause.cc/eyebrowse/
txgvnn · 2022-08-27 02:19
I'm using perspective integrate with project. When I switch to another project/find-file, it also switches workspace.
Maybe some cases still has bug, but it works for me long time to now, you can have a look how I configure it [https://github.com/TxGVNN/dots/blob/5f260c81035ba8364fac9dd83963172cc9fe3551/.emacs#L386](https://github.com/TxGVNN/dots/blob/5f260c81035ba8364fac9dd83963172cc9fe3551/.emacs#L386)
pudentia · 2022-08-27 04:57
Restoring is not easy in Emacs. maybe Session?
pudentia · 2022-08-27 04:59
>u can have any nu
I will def. look at this as I already have bookmark+ installed, but was unaware of that functionality.
pudentia · 2022-08-27 05:00
Awesome. Thanks.
yyoncho · 2022-08-27 07:48
Lsp-mode supports vscode workspaces and then you can use lsp-treemacs to integrate it with treemacs. Or you can use treemacs workspaces
pudentia · 2022-08-27 11:03
This morning I spent some time exploring the options you suggested and have for the time being settled on the following solution:
`persp-mode.el + workgroups`
I also bound `persp-frame-switch` to tab making it easy to switch between workspaces.
I find the inbuilt options not too intuitive, but perhaps I would need more time to explore them. I did not get to `bufler` or `burly`.
I need time to test these out and will revert back if necessary.
Thank you again.
HeiWiper · 2022-08-28 08:44
I recently started using workspaces in my workflow, and although I know many packages are available in Emacs such as the ones mentioned in the comments, but what worked for me so far is just make a second frame and use [ace-window](https://github.com/abo-abo/ace-window) with the variable `aw-scope` set to `'frame`. And from there I just move one frame to the appropriate workspace in my desktop environment and that's it. It's worth keeping in mind that the buffers are still shared so might not be the perfect workspace experience, but I don't think that matters in Emacs.
pudentia · 2022-08-30 17:04
Of all the solutions suggested, this one works best and it is the one I have chosen to use.
Frumpagumpus · 2022-08-30 18:02
spacemacs has a very sophisticated layout system that uses eyebrowse and maybe something else?
but basically you can have "workspaces" within "layouts", and can load layouts from files, etc.