Skip to content

Instantly share code, notes, and snippets.

@glucas
Created January 10, 2013 22:56
Show Gist options
  • Save glucas/4506530 to your computer and use it in GitHub Desktop.
Save glucas/4506530 to your computer and use it in GitHub Desktop.
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