Hello!
I usually type M-x "buffer-menu", to change buffer. How can I do this with a shorter command? Its quite a long string to type.
thanx!
Hello!
I usually type M-x "buffer-menu", to change buffer. How can I do this with a shorter command? Its quite a long string to type.
thanx!
You can use C-x b
to change buffers. You have to enter the first few letters of the buffer name, and of course you can use completion. If you press TAB
(the most useful key in Emacs), a list of (matching) buffers appears. You can click in this list to switch to a buffer.
You can bind buffer-menu
to a key. Pick a key that's not used for another command — let's say f12
— and add the following line to the file ~/.emacs
:
(global-set-key (kbd "<f12>") 'buffer-menu)
There are many other interfaces to changing buffers in Emacs, and they can be significantly more efficient than C-x b
and C-x C-b
. Since this tends to be a very personal choice, I recommend you experiment with a few and keep the one(s) you feel most comfortable with.
I'd highly recommend switching to a mode designed for efficient buffer switching.
If your version of Emacs is recent enough (22+):
M-x ido-mode
and then:
C-x b
to switch buffers, with incremental substring matching, C-s and C-r rotate forward and backwards through the matches.
If you have an older version of Emacs, it should have:
M-x iswitchb-mode
and then, as with ido-mode:
C-x b
opens up the minibuffer to let you choose the buffer to switch to.