0

I use ibuffer-sidebar-mode and when you are on a file buffer name in it and hit enter, I am not sure how it decides where to open that buffer if the rest of the window is split in multiple buffers. I want the buffer on the current line (when in ibuffer-sidebar) to be always opened in the most recently selected window. If you are familiar with treemacs, I want the same behaviour as you get by o r in treemacs.

Or, if you simply do C-x b and open a buffer, it always opens the buffer where the cursor last was aka the most recently selected window. Here are my use-package configurations,

;; ibuffer
(use-package ibuffer
  :ensure t 
  :init
  (setq ibuffer-expert t) ; disable prompt when deleting modified buffer
  (setq ibuffer-saved-filter-groups
        '(("my-filters"
           ;; match all *.pdf
           ("Document" (name . ".*\.pdf"))
           ;; match anything between asterisks
           ("Internal" (name . "\*.*\*")))))
  ;; Uncomment to have ibuffer on startup
  ;; (ibuffer-sidebar-toggle-sidebar)
  :hook
  (ibuffer-sidebar-mode
   . (lambda ()
       (ibuffer-switch-to-saved-filter-groups "my-filters")
       ;; keeps ibuffer list up to date
       (ibuffer-auto-mode 1))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.