Here is a handy function to toggle between the two most recent buffers. It has the same effect as C-x b RET
but can be bound to a simple key combination. I set it to C-`
since it reminds me of the CMD-`
used in OS X to switch between windows of the same app.
This code comes from the emacs wiki
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; toggle between most recent buffers ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; http://www.emacswiki.org/emacs/SwitchingBuffers#toc5 (defun switch-to-previous-buffer () "Switch to most recent buffer. Repeated calls toggle back and forth between the most recent two buffers." (interactive) (switch-to-buffer (other-buffer (current-buffer) 1))) ;; set key binding (global-set-key (kbd "C-`") 'switch-to-previous-buffer)