Skip to content

Instantly share code, notes, and snippets.

@paxperscientiam
Last active October 22, 2015 19:28
Show Gist options
  • Save paxperscientiam/eeb7c598791109ba70cf to your computer and use it in GitHub Desktop.
Save paxperscientiam/eeb7c598791109ba70cf to your computer and use it in GitHub Desktop.
Kill and copy an expression result.
(define-key global-map (kbd "C-x C-j")
(defun kill-copy-eval-sexp (arg)
"The function `kill-copy-eval-sexp' kill-saves and copies an
expression result using `simpleclip-mode'."
(interactive "P")
(set-register ?1 (format "%s"(eval-last-sexp arg)))
(simpleclip-set-contents (get-register ?1))
(kill-new (get-register ?1))
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment