1

How to sort the list of buffers Vim displays on entering :b <Tab> by most recent?

I'm used to the Spacemacs ordering, which displays buffer filenames in separate rows (vertically) in the order of most recent access.

I like accessing files by autocompleting the filename, so :ls is not an option. I do not interact with buffers in other ways, so I'm fine with breaking things or using plugins. I already use fzf.vim.

There were some similar questions, but nothing directly relevant to my problem.

New contributor
Daniel Paleka is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
8
  • 1
    can you explain what you mean by "after :b" and "displaying vertically?" – Mass Jun 10 at 0:18
  • 1
    Sorry, it is actually after :b <Tab>. – Daniel Paleka Jun 10 at 0:33
  • This does not answer your question, but I have two recommendations for your cases: bufexplorer for viewing buffers; They are ordered by last used by default. Then ctrl-p for a fuzzy file finder. Super easy to use and even more useful. – earthling Jun 10 at 6:09
  • Pretty sure tab completion of buffers is core, non-configurable functionality, i.e. short of someone basically (re)implementing something similar in vimscript you're stuck with lexicographical ordering. – B Layer Jun 10 at 10:09
  • Actually, looking at the accepted answer found through the third link you provided, which pretty much says what I said about tab completion ordering...you're not going to get any substantially different answer here. At least not without expanding your horizons beyond just tab completion. (FYI, the author was a major contributor here, too, and knows what they're talking about.) – B Layer Jun 10 at 18:04

Your Answer

Daniel Paleka is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.