easysession.el – Easily persist and restore your Emacs editing sessions

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 every easysession-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 with easysession-load, save the Emacs editing session with easysession-save and easysession-save-as, delete the current Emacs session with easysession-delete, and rename the current Emacs session with easysession-rename.

Installation

MELPA

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, use easysession-switch-to or easysession-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 every easysession-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, causing easysession-save-mode to save only when Emacs exits.

Links

A Vim plugin for persisting and restoring Vim editing sessions easily and effortlessly

The Vim plugin vim-easysession, written by James Cherti, offers a convenient and effortless way to persist and restore Vim editing sessions. It can significantly increase productivity and save a lot of time for users who frequently switch between different projects and those who frequently open and close the Vim editor.

In addition to its automatic session management capabilities, the Vim plugin Easysession also offers a variety of useful Vim commands that allow users to save, switch, list and delete sessions manually.

Easysession features

  • Save and restore the session “main”, which includes various settings such as the font, background, and color scheme (The &guifont, &background, and the color scheme are also part of the session file that is generated by Easysession)
  • Auto-complete the Vim commands :EasySessionLoad and :EasySessionRemove
  • Specify the directory where the session files are located:
    let g:easysession_dir = expand('~/.my_vim_sessions')
  • Save the session:
    :EasySessionSave
  • Switch to a different session:
    :EasySessionLoad SESSION_NAME
  • List the available sessions:
    :EasySessionList
  • Delete a session with:
    :EasySessionRemove SESSION_NAME

Please star vim-easysession on GitHub to support the project!

Installation

The Vim plugin Easysession can be installed with Vim’s built-in package manager (Vim 8 and higher):

mkdir -p ~/.vim/pack/jamescherti/start
cd ~/.vim/pack/jamescherti/start
git clone --depth 1 https://github.com/jamescherti/vim-easysession
vim -u NONE -c "helptags vim-easysession/doc" -c qCode language: JavaScript (javascript)

The plugin can also be installed with any third-party plugin manager such as Pathogen or Vundle.

Conclusion

The Vim plugin Easysession provides an easy and effortless way to persist and restore Vim editing sessions. Its automatic session management capabilities, manual commands, auto-complete feature, and its ability to specify the directory for saves session are all valuable features that make it easy to manage Vim editing sessions.

If you are looking for a way to manage and organize your Vim session more efficiently, the Easysession Vim plugin is an excellent option to consider.