Yaps makes your *scratch*
buffer persistent and not killable (bury instead).
If you don't have ELPA package in your Emacs, clone this repository and load file.
git clone https://github.com/rayw000/yaps.git
(load-file "/path/to/yaps/yaps.el")
Or install with ELPA
M-x package-install <RET> yaps <RET>
(require 'yaps)
(yaps-setup)
You may want to hook yaps-setup
to emacs-startup-hook
.
(add-hook 'emacs-startup-hook 'yaps-setup)
yaps-save-scratch-data
: Save scratch contents intoyaps-data-directory
.C-x C-s
is remapped to this function.yaps-clear-scratch-data
: Clear scratch contents.yaps-bury-scratch-buffer
: Bury (instead of kill) scratch buffer.yaps-restore-data-from-file
: Restore data from yaps data file.
yaps-scratch-buffer-name
: Buffer name which you want to useyaps
with, default to*scratch*
.yaps-data-directory
: Directory to store yaps data fileyaps.data
.
You can bind your favorite keys in yaps-mode-map
. For example,
(define-key yaps-mode-map (kbd "C-c C-r") 'yaps-restore-data-from-file)