workgroups2
workgroups2 copied to clipboard
Workgroups2 - Emacs session manager
- Workgroups2 [[https://github.com/pashinin/workgroups2/actions/workflows/test.yml][https://github.com/pashinin/workgroups2/actions/workflows/test.yml/badge.svg]] [[http://melpa.org/#/workgroups2][file:http://melpa.org/packages/workgroups2-badge.svg]] [[http://stable.melpa.org/#/workgroups2][file:http://stable.melpa.org/packages/workgroups2-badge.svg]]
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)
Fork it, [[https://github.com/pashinin/workgroups2/wiki/How-to-restore-a-specific-type-of-buffer][add more special buffers support]]. Or even better - fix bugs.
** Install Just install "workgroups2" from Melpa and activate it with
#+begin_src elisp (require 'workgroups2) #+end_src
** Usage *** Quick Start Use =M-x wg-create-workgroup= to save save window&buffer layout as a work group.
Use =M-x wg-open-workgroup= to open an existing work group.
Use =M-x wg-kill-workgroup= to delete an existing work group. *** Enable minor mode =workgroups-mode= (OPTIONAL) Put below line at the bottom of =.emacs=, #+begin_src elisp (workgroups-mode 1) #+end_src
Most commands are bound to both =
By default prefix is: "C-c z" (To change it - see settings below)
#+begin_example
If you want to set up this minor mode further: #+begin_src elisp (require 'workgroups2) ;; Change prefix key (before activating WG) (setq wg-prefix-key "C-c z")
(workgroups-mode 1) ; put this one at the bottom of .emacs
#+end_src
** Tips (OPTIONAL)
*** Change workgroups session file
Use below code
#+begin_src elisp
(setq wg-session-file "~/.emacs.d/.emacs_workgroups")
#+end_src
*** Support special buffer
Here is minimum sample code to support =ivy-occur-grep-mode=,
#+begin_src elisp
(with-eval-after-load 'workgroups2
;; provide major mode, package to require, and functions
(wg-support 'ivy-occur-grep-mode 'ivy
((serialize . ,(lambda (_buffer) (list (base64-encode-string (buffer-string) t)))) (deserialize . ,(lambda (buffer _vars) (switch-to-buffer (wg-buf-name buffer)) (insert (base64-decode-string (nth 0 _vars))) ;; easier than ivy-occur-grep-mode' to set up
(grep-mode)
;; need return current buffer at the end of function
(current-buffer))))))
#+end_src
** FAQ
Simon Michael (AKA) has written a nice [[https://github.com/pashinin/workgroups2/issues/108#issuecomment-1001104900][FAQ]].
** License
workgroups2 is free software: you can redistribute it and/or modify it under the terms of the [[https://raw.githubusercontent.com/redguardtoo/workgroups2/master/LICENSE][GNU General Public License]] as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
workgroups2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [[https://raw.githubusercontent.com/redguardtoo/workgroups2/master/LICENSE][GNU General Public License]] for more details.
This extension is based on experimental branch of the [[http://github.com/tlh/workgroups.el][original repo]].