Created
January 10, 2013 22:56
-
-
Save glucas/4506530 to your computer and use it in GitHub Desktop.
Jumping to the most recent 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
(defalias 'last-buffer 'mode-line-other-buffer) | |
(global-set-key (kbd "M-O") 'last-buffer) | |
(defun my/split-window() | |
"Split the window to see the most recent buffer in the other window. | |
Call a second time to restore the original window configuration." | |
(interactive) | |
(if (eq last-command 'my/split-window) | |
(progn | |
(jump-to-register :my/split-window) | |
(setq this-command 'my/unsplit-window)) | |
(window-configuration-to-register :my/split-window) | |
(delete-other-windows) | |
(split-window-below) | |
(switch-to-buffer-other-window (other-buffer)))) | |
(global-set-key (kbd "M-9") 'my/split-window) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment