Skip to content

leoliu/easy-kill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 

Repository files navigation

Kill Things Easily in Emacs

Provide commands (easy-kill, easy-mark etc.) to let users kill or mark things easily.

easy-kill

easy-kill is a drop-in replacement for kill-ring-save. It saves something to kill-ring in this order:

  1. current region if active
  2. url at point (snarf char properties help-echo, shr-url, w3m-href-anchor etc.)
  3. email at point
  4. current line

Immediately following easy-kill, the follow keys are temporarily active:

  1. w -> word at point
  2. s -> sexp at point
  3. f -> file at point
  4. l -> list at point
  5. d -> defun at point
  6. D -> defun-name; works even when in a diff hunk
  7. b -> buffer-file-name or default-directory
  8. @ -> append selection to previous kill
  9. C-w -> kill selection
  10. +, - and 0..9 -> expand/shrink selection
  11. C-SPC -> turn selection into an active region
  12. C-g -> abort

Any other keys exit the temporary keymap and automatically save selection to the kill-ring. See M-w l (save list at point to the kill ring) in action in screenshot:

``M-w l``

easy-mark

easy-mark is similar to easy-kill but marks the region immediately.

easy-mark-sexp can be a handy replacement for mark-sexp, which allows +,=/- to do list-wise expanding/shrinking and marks the whole sexp even when in the middle of one.

To Use

easy-kill is available on MELPA.

(require 'easy-kill)
(global-set-key [remap kill-ring-save] 'easy-kill)
(global-set-key [remap mark-sexp] 'easy-mark-sexp)

Extensions

New things can be defined by following package thingatpt.el's convention, or by defining new functions named like easy-kill-on-THING-NAME. See easy-kill-on-buffer-file-name and easy-kill-on-url for examples.

Bugs

https://github.com/leoliu/easy-kill/issues

About

Kill & Mark Things Easily in Emacs

Resources

Stars

Watchers

Forks

Packages

No packages published