amp icon indicating copy to clipboard operation
amp copied to clipboard

Suggestion for the fuzzy search: moves files already opened on top

Open cecton opened this issue 5 years ago • 2 comments

I've started discovering and using amp for 2 days now and I have a few suggestions I would like to share. Here is the most important one:

TL;DR

In the fuzzy search result: first display the files that are already opened in a buffer and match the result, then the rest.

When the user is annoyed to see a file they are not working on anymore in the search result, they could simply close the buffer.

Alternative: a fuzzy search dedicated to the opened buffers.

Long Story

Coming from ViM I was used to use the tabs to change of file/buffer. Unfortunately it's not very handy when you have a lot of them and I discovered with Amp that this mechanism can be totally replaced by the fuzzy search of Amp.

BUT there is one problem: on a very large project there are more redundancy in the name of the files. Because of that it's hard to switch of buffer easily in Amp. It would be very nice if we could have a different way to order the items in the fuzzy search: first put the files that are already opened in a buffer, then the rest.

I think it would be the same than we have on browser: you type something in the URL bar, you get result from the search engine but also always from your bookmarks. I use that feature a lot.

cecton avatar Jan 07 '19 14:01 cecton

I like this idea.

From the beginning, I imagined that switching buffers in Amp would display an overlay with a list of open buffers (kind of like an Alt-Tab overlay in a desktop environment). I think that and your proposed idea could co-exist, but I'd be curious if my initial idea would be enough. I'll let you know when I get a chance to explore it!

jmacdonald avatar Feb 11 '19 02:02 jmacdonald

fzf.vim has a :Buffers command that does something like you mentioned @jmacdonald . It opens a modal with a list of all open buffers and then lets you fuzzy find all open buffers by name.

neur0manc avatar Mar 16 '21 10:03 neur0manc