The easysession.el Emacs package is a lightweight session manager for Emacs that can persist and restore file editing buffers, indirect buffers (clones), Dired buffers, the tab-bar, and Emacs frames (including or excluding the frame size, width, and height). It offers a convenient and effortless way to manage Emacs editing sessions and utilizes built-in Emacs functions to persist and restore frames.
Key features include:
- Minimalistic design focused on performance and simplicity, avoiding unnecessary complexity.
- Persist and restore file editing buffers, indirect buffers/clones, dired buffers, tab-bar, the Emacs frame.
- Automatically save sessions by activating the mode with
easysession-save-mode
to ensure that the current session is automatically saved everyeasysession-save-interval
seconds and when emacs quits. - Helper functions: Switch to a session (i.e., load and change the current session) with
easysession-switch-to
, load the Emacs editing session witheasysession-load
, save the Emacs editing session witheasysession-save
andeasysession-save-as
, delete the current Emacs session witheasysession-delete
, and rename the current Emacs session witheasysession-rename
.
Installation
The easysession
package can be installed from MELPA by adding the following to your Emacs init file:
(use-package easysession
:ensure t
:custom
(easysession-save-interval (* 10 60))
:init
(add-hook 'emacs-startup-hook #'easysession-load-including-geometry 98)
(add-hook 'emacs-startup-hook #'easysession-save-mode 99))
Code language: JavaScript (javascript)
Note that:
easysession-load-including-geometry
is not needed after Emacs is loaded if you do not want EasySession to move or resize the Emacs frame when switching sessions. Instead, useeasysession-switch-to
oreasysession-load
to switch to another session or reload the current session without resizing or moving the Emacs frames.- The
easysession-save-mode
ensures that the current session is automatically saved everyeasysession-save-interval
seconds and when emacs quits. - The
easysession-save-interval
variable determines the interval between automatic session saves. Setting it to nil disables timer-based autosaving, causingeasysession-save-mode
to save only when Emacs exits.
Links
- More information about easysession.el: easysession.el @GitHub
- easysession.el @MELPA
- There is also a Vim version of Easysession: vim-easysession