Scratch buffers one command away
The goal of this basic mode is to easily create scratch buffer to edit in the curreny major mode you are using.
Fonctionalities are limited for now to this:
- you can create a scratch buffer with the current mode you are using
omni-scratch-major
. Calling it a second time from the scratch buffer will bring you back to the buffer you came from - you can create a scratch buffer attached to your current buffer with
omni-scratch-buffer
- you can create a new scratch buffer with
omni-scratch
. (Default tofundamental-mode
, configurable withomni-scratch-default-mode
) - you can go to the latest edited scratch with
omni-scratch-goto-latest
- you can quit a scratch buffer with
omni-scratch-quit
which will save its content to the kill ring - you can select a buffer from a list if helm is installed with
omni-scratch-buffers
- calling a scratch function with
C-u
, the universal arg, open the scratch buffer in other window
Inside a scratch buffer you have access to the following bindings:
M-s $ e
: erase bufferM-s $ e
: write to file scratchM-s $ p
: paste content (using spacemacs paste transient mode if defined, otherwise simpleyank
)M-s $ b
: open a buffer list of the scratch buffersM-s $ q
: quit buffer, copying its content to kill ring
You can install it from melpa, or put the files in your load path, and require it.
If you use use-package you could use the following config
(use-package omni-scratch
:bind (("M-s $ DEL" . omni-scratch)
("M-s $ -" . omni-scratch-major)
("M-s $ _" . omni-scratch-buffer)
("M-s $ $" . omni-scratch-goto-latest)
("M-s $ b" . omni-scratch-buffers)))
Here are the variable you can customize about omni-scratch:
omni-scratch-default-mode
: the mode for the scratch buffer. By defaultfundamental-mode
omni-scratch-lighter
: the lighter indicating a omni-scratch buffer. By defaultΞ²
.omni-scratch-pale-background
: If true (default), scratch buffer are more pale than other buffersomni-scratch-pale-percent
: how pale are the scratch buffers.
This is still a prototype. So if ever you think about using it, prefer the master
branch or elpa stable, and expect to update your config from times to times until stabilization.
Name of function and even behavior might change, so donβt be suprised. This will be reported in the Changelog.
If you have any remark, refactor suggestion or else, just pose an issue ;)