Skip to content

Instantly share code, notes, and snippets.

@Hendekagon
Created May 19, 2017 15:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hendekagon/15f791a37035e61320786f9afaa8c914 to your computer and use it in GitHub Desktop.
Save Hendekagon/15f791a37035e61320786f9afaa8c914 to your computer and use it in GitHub Desktop.
copy2clip
(defn copy2clip [x]
(let [w (StringWriter.)]
(pprint x w)
(.. Toolkit getDefaultToolkit getSystemClipboard
(setContents (StringSelection. (.toString w)) nil))))
@Hendekagon
Copy link
Author

image
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment