Skip to content

Instantly share code, notes, and snippets.

@menyf
Created December 24, 2018 20:12
Show Gist options
  • Save menyf/da997bad395ed87d128c732ba48d5dda to your computer and use it in GitHub Desktop.
Save menyf/da997bad395ed87d128c732ba48d5dda to your computer and use it in GitHub Desktop.
(defun copy-from-osx ()
(shell-command-to-string "pbpaste"))
(defun paste-to-osx (text &optional push)
(let ((process-connection-type nil))
(let ((proc (start-process"pbcopy" "*Messages*" "pbcopy")))
(process-send-string proc text)
(process-send-eof proc))))
(setq interprogram-cut-function 'paste-to-osx)
(setq interprogram-paste-function 'copy-from-osx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment