Created
December 20, 2013 07:04
-
-
Save bmnn/8051364 to your computer and use it in GitHub Desktop.
emacs; clipboard; insert; put;
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
;r;(url='https://groups.google.com/d/msg/gnu.emacs.help/I2_E_eJxrcc/iwpwMYTleY0J') | |
(defun clipboard-get () | |
"Visit clipboard-temp-file, delete all text in it, yank the X | |
clipboard, delete trailing whitespace, go to beginning of | |
buffer." | |
(interactive) | |
(delete-region (point-min) (point-max)) | |
(clipboard-yank) | |
(delete-trailing-whitespace) | |
(goto-char (point-min))) | |
(defun clipboard-put () | |
"Copy the whole buffer to the X clipboard, kill it." | |
(interactive) | |
(clipboard-kill-ring-save (point-min) (point-max)) | |
(save-buffer) | |
) | |
(global-set-key "\C-xg" 'clipboard-get) | |
(global-set-key "\C-xp" 'clipboard-put) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment