0

I would like to use normal modes commands like d c x etc without the content being copied to clipboard.

I want to make emacs so that only y command will write anything to the clipboard. Other commands like d should only delete the content without writing anything to the clipboard.

1

(setq save-interprogram-paste-before-kill nil)

Separating the clipboard and kill-ring is more efficient for my workflow, for clipboard, I use https://github.com/rolandwalker/simpleclip API simpleclip-set-content and simpleclip-get-content

| improve this answer | |
0

If you do C-h k d you'll see that d is bounded to evil-delete, so:

(define-key evil-normal-state-map "dd" 'my/very-special-evil-delete)

should do the work. There's a "/dev/null-ish" (blackhole) register in vim which probably evil mocks.

| improve this answer | |
0

This adds an advice around evil stuff to drop it to _ register.

(defun meain/evil-delete-advice (orig-fn beg end &optional type _ &rest args)
    "Make d, c, x to not write to clipboard."
    (apply orig-fn beg end type ?_ args))
(advice-add 'evil-delete :around 'meain/evil-delete-advice)
(advice-add 'evil-change :around 'meain/evil-delete-advice)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.