A Quick Easy Buffer Menu for Emacs
The one thing I absolutly love about IntelliJ is the little buffer switching menu you get with Super+G. Desperate to get this feature in Emacs, I whipped this little bit of Lisp up to help fill the gap.
;; used for quick menu switching between buffers
(defun menu-list-from-buffers ()
(cons "PANE" (mapcar (lambda (e) (list (buffer-name e) e)) (remove-if (lambda (e) (string-match "\*.*\*" (buffer-name e)) )(buffer-list))))
)
(defun menu-switch ()
(interactive)
(set-window-buffer nil (car (x-popup-menu t (list "Switch To Buffer" (menu-list-from-buffers)))))
)
(global-set-key (kbd "s-g") 'menu-switch)
Note that I've bound this function to Super+G. For Mac users this is Apple+G. Drop that little badboy into your .emacs file and you're off!
When you get it going it will look pretty much like this:
Written by John Singleton
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Emacs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#