Created
August 6, 2014 13:24
-
-
Save suzuki/097ed8809e1e327e3b42 to your computer and use it in GitHub Desktop.
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
(defun swap-buffers () | |
"Swapping buffers in two windows" | |
(interactive) | |
(let ((current-w (frame-selected-window)) | |
(current-b (window-buffer (frame-selected-window))) | |
(other-w (get-lru-window)) | |
(other-b (window-buffer (get-lru-window)))) | |
(if (not (one-window-p)) | |
(progn | |
(select-window current-w) | |
(switch-to-buffer other-b) | |
(select-window other-w) | |
(switch-to-buffer current-b) | |
)))) | |
(global-set-key (kbd "C-x \\") 'swap-buffers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment