Comments
-
Greg Hurrell
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?
-
Greg Hurrell
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.
-
Greg Hurrell
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 overridablesort
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
-
probably need an autocmd hook to record
-
Greg Hurrell
This was recently implemented, so closing.
-
Greg Hurrell
Status changed:
- From: new
- To: closed
Add a comment
Comments are now closed for this issue.