In vim :let @"=@*
will copy the content of*
register to the "
register. How can it be done with evil?
2 Answers
This code should do that.
(set-register ?" (get-register ?*))
If you want that in a command:
(defun foo ()
(interactive)
(set-register ?" (get-register ?*)))
Or if you want a command that reads the register names:
(defun copy-register-to-register (from to)
(interactive
(list (register-read-with-preview "From register: ")
(register-read-with-preview "To register: ")))
(set-register to (get-register from)))
(Emacs registers are not particular to Evil, so Evil is, I think irrelevant to your question. Evil may be how you interact with registers, but setting them with Elisp should independent of Evil.)
(evil-set-register ?\" (evil-get-register ?*))
-
Could you say something about how these versions are in relation to than the standard emacs functions? Should they be preferred? Apr 5, 2021 at 9:39