使用 bpcopy 和bppaste 替代剪切  x-clipborad

elisp code :

;;osx should using pbpaste and pbcopy to share clipboard
(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))))


(when (string= system-type "darwin")
        (setq interprogram-cut-function 'paste-to-osx)
        (setq interprogram-paste-function 'copy-from-osx))

 

相关文章:

  • 2021-11-20
  • 2021-11-28
  • 2021-07-13
  • 2022-12-23
  • 2021-10-02
  • 2021-06-08
猜你喜欢
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2021-08-31
  • 2021-10-18
相关资源
相似解决方案