Skip to content

Instantly share code, notes, and snippets.

@abhiyerra
Created November 6, 2013 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhiyerra/7332452 to your computer and use it in GitHub Desktop.
Save abhiyerra/7332452 to your computer and use it in GitHub Desktop.
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