Skip to content

kostafey/temporary-persistent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 

Repository files navigation

License GPL 3

temporary-persistent

temporary-persistent - easy way to switch temp buffers and keep them persistent.

When you open a temp buffer you don't need to save it manually, it'll be saved automatically any time you kill this buffer or Emacs.

See also: persistent-scratch

Installation

Add MELPA (if not yet) to your package-archives list.

Then you can install temporary-persistent with the following command:

M-x package-install [RET] temporary-persistent [RET]

Configuration

Switch to temp buffer keybinding

The only usefull function you should bind to customize this package is temporary-persistent-switch-buffer. As for me, I'm rarely close my Emacs, so I dislike to waste handy C-x C-c keys. But you can use any bindings you like.

(global-set-key (kbd "C-x C-c") 'temporary-persistent-switch-buffer)

Then, when you press C-x C-c, *temp* buffer will be created. When you press M-1 C-x C-c, *temp-1* buffer will be created and so on.

There are 3 cases Emacs save your temp buffer:

  • kill-buffer
  • kill-emacs
  • Save buffer manually via ordinary save-buffer function.

Default submodes

You can enable some submodes for new temp buffers by default:

(setq temporary-persistent-default-submodes (list 'linum-mode
                                                  'auto-fill-mode
                                                  'auto-complete-mode))

Directory to keep temporary buffers data

Change folder to keep temporary buffers data if you like:

(setq temporary-persistent-store-folder "~/temp")

Buffer name template

You can also change template for temporary buffer names:

(setq temporary-persistent-buffer-name-template "temp")

Requirements:

License

Copyright © 2016-2023 Kostafey kostafey@gmail.com

Distributed under the General Public License 3.0+

About

Switch to temp buffers and keep them persistent.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •