Skip to content

Instantly share code, notes, and snippets.

@glucas
Created Jan 10, 2013
Embed
What would you like to do?
Jumping to the most recent buffer.
(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