GitHub - AdrieanKhisbe/omni-kill.el: M-x kill-all-the-thing
source link: https://github.com/AdrieanKhisbe/omni-kill.el
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Omni Kill
Kill all the things! \o/
Description
This library is here to help you quickly kill, copy, select, … things that are at point: emails, url, sentence, sexp…
It’s built on top of thingatpt
, and just provide wrapper functions.
Usage
Once loaded you will have at you disposal many commands to kill, grab, delete, “Things” that are at point.
The naming scheme for these commands are by default omni-ACTION-THING
, with:
actionskill, copy, delete, select, narrow, save (to register), go to start / end
thingssymbol
, list
, sexp
, defun
, filename
, url
, email
, word
, sentence
, whitespace
, line
, page
aka the default thingatpt
)
Besides you can use the dispatch functions. They take as argument the next key you type, and look on an alist to get the associated thing.
These are named omni-ACTION
, and the char to thing association can be customized through the omni-kill-thing-to-letter-alist
custom.
For example calling omni-kill
followed by the letter e
, will kill the current email
at point if any.
(these function accept thing as symbol in non interactive use)
Installation
To install it, install the package from melpa
or just put the omni-kill.el
in your load path, and require it.
Then bind the commands to the keybinding that suit you.
Configuration
If you are using use-package
, here is the config you could use.
(use-package omni-kill :defer nil :bind (("M-s c". omni-copy) ("M-s d". omni-delete) ("M-s k". omni-kill) ("M-s s". omni-select) ("M-s n". omni-narrow) ("M-s r". omni-save) ("M-s a". omni-start) ("M-s e". omni-end)))
Defer nil is needed so that the omni-ACTION-THING
are created by loading the library. (there is no autoload for these commands, as they are macro generated)
If you want to adapt or change the naming scheme, just run M-x customization-group RET omni-kill
.
You can also add to the list your custom things
. By default you will get omni-copy-url
, omni-delete-line
, and so on.
Notes
This is still a young library. So if ever you think about using it,
and not fetching it from melpa, prefer the master
branch, and expect to update your config.
Work is still in progress, but I’ll try to avoid incompatible change on he master
branch
If you have any remark, refactor suggestion or else, just pose an issue ;)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK