wincent / command-t

⌨️ Fast file navigation for Neovim and Vim
BSD 2-Clause "Simplified" License
2.76k stars 321 forks source link

Request: (Option to) Show recently-matched files when opening Command T #268

Closed dylan-chong closed 7 years ago

dylan-chong commented 7 years ago

similar to the behaviour of double pressing shift in intellij ides. Currently it shows the files within the current directory.

It would be useful if I want to re-do a search without having to type in the entire search term again

As a potentially related idea, a recent files window could be useful. It may even replace the above request

wincent commented 7 years ago

As a potentially related idea, a recent files window could be useful. It may even replace the above request

There is already a jump list finder and a most-recently-used buffer finder. Do either of those suit your needs?

It would be useful if I want to re-do a search without having to type in the entire search term again

Agreed, that could definitely be useful. Would just need to think of the right binding for it. Could be Control-Something to populate the search field with the previous search, or something "magic" (ugh) like double-space.

similar to the behaviour of double pressing shift in intellij ides. Currently it shows the files within the current directory.

I don't think I would implement this as described because it is trivial to explore the files in the current directory using features already built into Vim (eg. netrw). The feature could certainly be used for inspiration for something else, but we'd need some clear definition about exactly what that "something else" should be.

dylan-chong commented 7 years ago

Awesome! Both of these seem to fit the requirement, although I prefer the most-recently-used window. I don't know how I missed those in the documentation. Surely I searched the word 'recent'...

I wonder if it would be possible to use the information in the most-recently-used window to sort the files in the normal command t window... It's not at all necessary in order to achieve what I want, but it's just a thought.

wincent commented 7 years ago

I wonder if it would be possible to use the information in the most-recently-used window to sort the files in the normal command t window... It's not at all necessary in order to achieve what I want, but it's just a thought.

This is a logical enough request, but there are some tricky edge cases to consider that make it difficult. For example, consider https://github.com/wincent/command-t/issues/107 which is about an even simpler problem of never sorting the current file as most relevant; even that simple scenario has a bunch of sharp corners to it. Anything which messes with the sorting/scoring algorithm is going to be a bit thorny. Not to say that we shouldn't do it, just that it would be tricky.

Another issue about sort order:

And another one related to your idea above:

It would be useful if I want to re-do a search without having to type in the entire search term again

Going to close this one for now as I don't think there is anything actionable that isn't already reflected in those two issues above.