I want to copy just one character underneath the cursor. Its not ascii, so I can't type it. Is there a function or key that allows for this?
Vanilla emacs welcome, though evil and spacemacs answers are also acceptable.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityI want to copy just one character underneath the cursor. Its not ascii, so I can't type it. Is there a function or key that allows for this?
Vanilla emacs welcome, though evil and spacemacs answers are also acceptable.
Three keys, as observed by view-lossage
C-SPC ;; set-mark-command
C-f ;; forward-char
<escape> w ;; kill-ring-save
You can add this function in your init file:
(defun kill-ring-save-char-at-point ()
"save the character at point in the kill-ring "
(interactive)
(unless (eq (point) (point-max))
(kill-ring-save (point) (1+ (point)))))
and bind it to a key of your choice.
spacemacs (evil): Copy: vy Paste: p