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.

3 Answers 3

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

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.

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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