Skip to content

Making the order of recent buffers in consult-buffer local to each window #1140

Description

@egr95

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-sort function that uses some sort of window-parameter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions