diff options
| author | Jakob L. Kreuze | 2019-03-13 09:55:30 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze | 2019-03-13 09:55:30 -0400 |
| commit | 6315fa086921ded0fc7b5389f74d889814d6c459 (patch) | |
| tree | 6ba169f5d23bd456725ef5adc84e866be65ed594 /jakob.org | |
| parent | 49723b4fd52a12c95f1e5a261f104b864ea4d573 (diff) | |
Add custom replacements for kill-word and backward-kill-word
Diffstat (limited to 'jakob.org')
| -rw-r--r-- | jakob.org | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 |