Skip to content

πŸ“‹ Easy and mode-specific draft buffers for emacs πŸ“

Notifications You must be signed in to change notification settings

AdrieanKhisbe/omni-scratch.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

71 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Omni-scratch.el

Scratch buffers one command away

https://travis-ci.org/AdrieanKhisbe/omni-scratch.el.svg https://coveralls.io/repos/AdrieanKhisbe/omni-scratch.el/badge.svg http://melpa.org/packages/omni-scratch-badge.svg http://stable.melpa.org/packages/omni-scratch-badge.svg https://img.shields.io/github/tag/AdrieanKhisbe/omni-scratch.el.svg http://img.shields.io/:license-gpl3-blue.svg

Description

The goal of this basic mode is to easily create scratch buffer to edit in the curreny major mode you are using.

Usage

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 to fundamental-mode, configurable with omni-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 buffer
  • M-s $ e : write to file scratch
  • M-s $ p : paste content (using spacemacs paste transient mode if defined, otherwise simple yank)
  • M-s $ b : open a buffer list of the scratch buffers
  • M-s $ q : quit buffer, copying its content to kill ring

Installation

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)))

Customization

Here are the variable you can customize about omni-scratch:

  • omni-scratch-default-mode : the mode for the scratch buffer. By default fundamental-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 buffers
  • omni-scratch-pale-percent: how pale are the scratch buffers.

About

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 ;)

About

πŸ“‹ Easy and mode-specific draft buffers for emacs πŸ“

Resources

Stars

Watchers

Forks

Packages

No packages published