Created
May 19, 2017 15:18
-
-
Save Hendekagon/15f791a37035e61320786f9afaa8c914 to your computer and use it in GitHub Desktop.
copy2clip
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
(defn copy2clip [x] | |
(let [w (StringWriter.)] | |
(pprint x w) | |
(.. Toolkit getDefaultToolkit getSystemClipboard | |
(setContents (StringSelection. (.toString w)) nil)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add copy2clip to a namespace, then add the above command to Cursive's commands and give it a keyboard shortcut, then you can evaluate an expression in the editor and it will be copied so you can paste the result back into the editor