summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze2019-03-13 09:55:30 -0400
committerJakob L. Kreuze2019-03-13 09:55:30 -0400
commit6315fa086921ded0fc7b5389f74d889814d6c459 (patch)
tree6ba169f5d23bd456725ef5adc84e866be65ed594
parent49723b4fd52a12c95f1e5a261f104b864ea4d573 (diff)
Add custom replacements for kill-word and backward-kill-word
-rw-r--r--jakob.org22
1 files changed, 22 insertions, 0 deletions
diff --git a/jakob.org b/jakob.org
index de37f0d..c50c27d 100644
--- a/jakob.org
+++ b/jakob.org
@@ -288,6 +288,28 @@ Unbind <C-z> and <C-x C-z> so that I'm not accidentally calling =suspend-frame=.
(global-unset-key (kbd "C-x C-z"))
#+END_SRC
+** Kill-Ring
+
+Replace =kill-word= and =backward-kill-word= with equivalents that do not push the
+region to the kill ring.
+
+#+BEGIN_SRC elisp
+(defun delete-word (arg)
+ "Delete characters forward until encountering the end of a word.
+With argument ARG, do this that many times."
+ (interactive "p")
+ (delete-region (point) (progn (forward-word arg) (point))))
+
+(defun backward-delete-word (arg)
+ "Delete characters backward until encountering the beginning of a word.
+With argument ARG, do this that many times."
+ (interactive "p")
+ (delete-word (- arg)))
+
+(bind-key "M-d" #'delete-word)
+(bind-key "M-DEL" #'backward-delete-word)
+#+END_SRC
+
* Quality-of-Life
** Ivy

© 2015 - 2026 Jakob L. Kreuze