Created
November 6, 2013 07:55
-
-
Save abhiyerra/7332452 to your computer and use it in GitHub Desktop.
Kill and paste disjoint buffers
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
(setq ay/disjoint-buffer '()) | |
(defun ay/disjoint-kill () | |
(interactive) | |
(add-to-list 'ay/disjoint-buffer | |
(buffer-substring-no-properties | |
(region-beginning) | |
(region-end))) | |
(delete-region (region-beginning) | |
(region-end))) | |
(defun ay/disjoint-yank () | |
(interactive) | |
(mapcar (lambda (arg) | |
(insert arg "\n")) | |
ay/disjoint-buffer) | |
(setq ay/disjoint-buffer '())) | |
(global-set-key "\C-c\C-w" 'ay/disjoint-kill) | |
(global-set-key "\C-c\C-y" 'ay/disjoint-yank) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment