emacs list-buffers behavior

前端 未结 9 1250
情话喂你
情话喂你 2021-02-01 12:39

In GNU emacs, every time I hit Ctrl-x Ctrl-b to see all of my buffers, the window is split to show the buffer list, or if I have my window already split in 2 (for ins

相关标签:
9条回答
  • 2021-02-01 13:27

    Strangely, there isn't an answer here about ibuffer.

    I would recommend this as a standard change for the majority of Emacs users:

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

    ibuffer is a very advanced replacement for the default buffer listing, and not only features the exact behaviour requested, but provides a wealth of other functionality.

    I listed a few ibuffer filtering and grouping basics in Emacs: help me understand file/buffer management, but be sure to read the documentation for details.

    0 讨论(0)
  • 2021-02-01 13:29

    Try to add

    (ido-mode 1)
    

    to your .emacs, and enjoy the result :)

    0 讨论(0)
  • 2021-02-01 13:31

    If you like the original buffer list (as opposed to the 'buffer-menu solution proposed by others), you can use this:

    (global-set-key (kbd "C-x C-b") 'my-list-buffers)
    (defun my-list-buffers (&optional files-only)
      "Display a list of names of existing buffers.
    The list is displayed in a buffer named `*Buffer List*'.
    Note that buffers with names starting with spaces are omitted.
    Non-null optional arg FILES-ONLY means mention only file buffers.
    
    For more information, see the function `buffer-menu'."
      (interactive "P")
      (switch-to-buffer (list-buffers-noselect files-only)))
    

    Which is the same function as before, only in the current window.

    0 讨论(0)
提交回复
热议问题