Replies: 2 comments 3 replies
|
Hi! This sounds like a good idea. One can use the (lambda ()
(consult--buffer-query :sort 'window-local ;; Note that window-local does not yet exist.
:as #'consult--buffer-pair)) |
|
Hi @minad I have a similar but slightly different problem: I always use C-x b to jump back to the previous buffer, but if it is shown in a different window, it will be lowered to the bottom. This gets annoying very soon if you view the same buffer in two windows. In this case, a window-local sorting would help. I searched and found this discussion, but unfortunately the solution from 2024 does not work anymore (the displayed buffer is still lowered). Would it be possible there is a simpler solution for two-window-same-buffer case, since it does not really require window-local sorting for the two-window-same-buffer case? Thanks! |
Uh oh!
There was an error while loading. Please reload this page.
When I run consult-buffer, the first candidates displayed are the previous buffers I have visited, from most to least recent (excluding buffers that are visible in other windows). Is it possible to configure this ordering to behave locally to each window?
To be more specific, say I have a vertical window split, and I am looking at buffer A on the left, and B on the right. Suppose I switch to buffer C on the left split, and then jump to the right with other-window and switch to buffer D. If I then jump back to the left and run consult-buffer, the first entry will be B, whereas I would like it to be A. This is useful because often one might use a specific window split for a specific type of buffer, and it is convenient to quickly cycle through the recently-visited buffers specifically in that window split. This is also how VScode buffer-switching works.
I don't understand the consult internals particularly well, but as far as I could tell this is not something that is directly available in the configuration options. Perhaps it would be a matter of adding an additional
consult--buffer-sortfunction that uses some sort ofwindow-parameter?All reactions