Created
August 6, 2014 05:28
-
-
Save v2e4lisp/3f03b629ee84642086c1 to your computer and use it in GitHub Desktop.
copy to clipboard from emacs in terminal
This file contains hidden or 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
;; copy to clipboard from emacs in terminal | |
;; | |
;; if you use emacs in tmux you should enable pbcopy in tmux first | |
;; http://superuser.com/questions/231130/unable-to-use-pbcopy-while-in-tmux-session | |
(defun pbcopy-region (start end) | |
(interactive "r") | |
(pbcopy (buffer-substring start end))) | |
(defun pbcopy (string) | |
(shell-command (concat "echo " | |
(shell-quote-argument string) | |
" | pbcopy"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment