≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Feature request #1812

Feature request #1812: Sort buffers by last used

Kind feature request
Product Command-T
When Created 2011-05-02T07:13:36Z, updated 2014-07-30T15:01:53Z
Status closed
Reporter anonymous
Tags no tags

Description

I would like the buffers listed by CommandTBuffer to be listed by the last used, as is done by fuzzy-finder. Additionally, like fuzzy-finder I would like the buffer list to not include the current buffer.

Comments

  1. Greg Hurrell 2011-05-02T07:45:56Z

    I wonder how useful either of these would be.

    The ordering of results obviously needs to be according to the scoring algorithm, so the buffers which best match the search string will appear first in the list. The only time when the scoring algorithm isn't at play is when no characters have been typed at the search prompt yet, and we're currently just showing those in buffer number order. So if I understand correctly, you're proposing that this initial ordering instead be last-used order. I am not sure how useful that will be, seeing as the very first character you type at the prompt will cause that initial ordering to be thrown away.

    The other one would probably not be too hard to add, but again, I am not sure of the value of it. What is wrong with the current buffer appearing in the buffer list? How would removing it improve your workflow?

  2. Greg Hurrell 2011-05-06T16:57:40Z

    Just received another request for last-used order in the buffer search:

    When running :CommandTBuffer, it'd be awesome if it was sorted in order of last use. That way you could just hit <leader>b followed by a quick enter to toggle back to your last used file. I know I already have b# bound for quick access, but why not run everything through Command-T?

    Sounds like a good idea; I hadn't thought of that use case.

  3. Greg Hurrell 2011-05-08T07:09:41Z

    Looking at how this might be done:

    • probably need an autocmd hook to record BufEnter events and record a stack of seen buffers
    • and probably will want to subclass the Matcher class and extract an overridable sort method so that the subclass can override the default alphabetical order
    • not sure where to suppress the display of the current buffer; quite possibly in the BufferScanner class
  4. Greg Hurrell 2014-07-30T15:01:49Z

    This was recently implemented, so closing.

  5. Greg Hurrell 2014-07-30T15:01:53Z

    Status changed:

    • From: new
    • To: closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets