5

I use Emacs across different machines and operating systems. I noticed that when I press C-x C-b to get a list of all buffers, on some machines the list opens in the same window where the cursor is located and allows me to arrow through the list, using ENTER to select and open the buffer I desire.

Yet, on other machines this list opens in the other window (I usually have at least two open) and even after I switch to that window using C-x o, I am not able to arrow through the list, select and open.

How can I achieve the first type of behavior on the latter machines?

3
  • 2
    Do you have any customizations that you are using across these machines? One thing to check is exactly what command C-x C-b is bound to in each case, using C-h k.
    – glucas
    Feb 7, 2018 at 3:51
  • 2
    Same behavior if you start Emacs using emacs -Q (no init file)? If not, bisect your init file to see what causes the behavior.
    – Drew
    Feb 7, 2018 at 4:03
  • 1
    See also C-h v same-window-buffer-names RET and C-h v same-window-regexps RET for determining which buffers should reuse the current window in general.
    – Basil
    Feb 7, 2018 at 15:02

1 Answer 1

9

I highly recommend using ibuffer in place of the default list-buffers command. This will provide not only the behaviour you're after, but also a tremendous amount of additional functionality in terms of filtering, grouping, and acting upon the listed buffers, should you wish to take advantage of that1.

(global-set-key (kbd "C-x C-b") 'ibuffer)

Or, if you want to change all global list-buffers bindings to use ibuffer:

(global-set-key [remap list-buffers] 'ibuffer)

1 See C-hf ibuffer-mode, or else type C-hm after M-x ibuffer (or after using its new keybinding).

1
  • Thanks. I installed it, and it appears really useful and handy thus far. Feb 19, 2018 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.