Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Kill and paste disjoint buffers
(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