Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Clap buffers" should be ordered in LRU-order #59

Closed
sscherfke opened this issue Oct 16, 2019 · 3 comments · Fixed by #71
Closed

"Clap buffers" should be ordered in LRU-order #59

sscherfke opened this issue Oct 16, 2019 · 3 comments · Fixed by #71
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@sscherfke
Copy link

The list displayed by :Clap buffers is currently sorted by buffer number. It would be more convenient if it was sorted descencingly by the time of last use.

I have mapped :Clap buffers to <leader>ob (open buffer). If the list was sorted by LRU, I could simply type ,ob<CR> to toggle between the both last used buffers (e.g., implementation and corresponding tests).

@liuchengxu
Copy link
Owner

liuchengxu commented Oct 16, 2019

An option would be nice and feel free to open up a PR, all you need to tweak is s:buffers:

function! s:buffers() abort
redir => l:buffers
silent buffers
redir END
let s:buffers_cache = split(l:buffers, "\n")
return s:buffers_cache
endfunction

The possible related api: :h getftime().

@liuchengxu liuchengxu added enhancement New feature or request help wanted Extra attention is needed labels Oct 16, 2019
@liuchengxu liuchengxu added this to the 0.1 milestone Oct 19, 2019
liuchengxu added a commit that referenced this issue Oct 19, 2019
liuchengxu added a commit that referenced this issue Oct 19, 2019
* Rework buffers provider

Close #8
Close #59

* Expand the fname

* Update CHANGELOG.md

* Try extension first

* Add clap_buffers syntax

* .
@sscherfke
Copy link
Author

Thank you for that fix! :-)

It would be nice, if the current buffer was omitted from the list (or at least, put at its end). Currently, you have to type an additioanl Ctrl+j (or down) to move to the second entry when you want to toggle between buffers.

@liuchengxu
Copy link
Owner

Makes some sense. Please create a new issue for that feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants