Created
June 5, 2011 16:41
-
-
Save danmayer/1009137 to your computer and use it in GitHub Desktop.
This function makes emacs move the current buffer to another window. It also closes the current tab and sets focus on the new buffer
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
;; move buffer to other window | |
;; after c-x 3 to split screen this lets you move buffers between sides. | |
;; altered code from: | |
;; http://stackoverflow.com/questions/1774832/how-to-swap-the-buffers-in-2-windows-emacs | |
(defun swap-buffer-window () | |
"Put the buffer from the selected window in next window, and vice versa" | |
(interactive) | |
(let* ((this (selected-window)) | |
(other (next-window)) | |
(this-buffer (window-buffer this))) | |
(set-window-buffer other this-buffer) | |
(tabbar-close-tab) ;;close current tab | |
(other-window 1) ;;swap cursor to new buffer | |
) | |
) | |
(global-set-key (kbd "C-x /") 'swap-buffer-window) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you don't use tabs just comment out the tabbar-close-tab function call