emacs list-buffers behavior

前端 未结 9 1257
情话喂你
情话喂你 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: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.

提交回复
热议问题