Last active
October 22, 2015 19:28
-
-
Save paxperscientiam/eeb7c598791109ba70cf to your computer and use it in GitHub Desktop.
Kill and copy an expression result.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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