Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This function makes emacs move the current buffer to another window. It also closes the current tab and sets focus on the new buffer
;; move buffer to other window
;; after c-x 3 to split screen this lets you move buffers between sides.
;; altered code from:
(defun swap-buffer-window ()
"Put the buffer from the selected window in next window, and vice versa"
(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)

This comment has been minimized.

Copy link
Owner Author

commented Jun 5, 2011

If you don't use tabs just comment out the tabbar-close-tab function call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.