Open mohitleo9 opened 10 years ago
I think he meant what CtrlP plugin does when searching. (Also Sublime Text and PhpStorm)
There is short animation how it looks in extreme case. You write DC
and it Matches D.*C.*
Instead of exact match of inserted word it "tries to figure out good enough match". It is meant as shortcut when you know coupple of keywords and their order. It is much faster than writing regular expression and o can gets to it unbelievably quckly.
example:
Lets take URL to this issue: https://github.com/1995eaton/chromium-vim/issues/91
I know it is issue on github and it is plugin for chrome, but don't remember exact name so I write:
github/chrom/issue
And hope autocomplete will suggest https://github.com/1995eaton/chromium-vim/issues/91
Fuzzy find can be created smart, but simple implementation could simply transform it to:
.*github.*/.*chrom.*/.*issue.*
Making it smarter is the harder part. For example you could do more searches each more general.
I might make PR, but I don't have much time this month.
Regex matching is enabled by default in certain modes (:history
and :bookmarks
). Is this the behavior you're looking for but in the :open
/:tabnew
commands?
No, fuzzy matching isn't regex matching. Fuzzy as a word coud be explained as not exact or incomplete
. Regex on the other hand is very exact.
Fuzzy search takes input and tries to interpret it.
You can use regex to implement it, but there would be component that would turn input into multiple separate regexular expressions automatically.
example:
User input | Expected autocompletion |
---|---|
github/chrom/issue | https://github.com/1995eaton/chromium-vim/issues/91 |
FacMarkZuck | https://www.facebook.com/zuck |
reddit/linux | https://www.reddit.com/r/linux/ |
linux reddit | https://www.reddit.com/r/linux/ |
Indeed I really miss this feature. I would only add to Jindrich's description that it would be better for the completion to use both the URL and the titles of pages.
This would be an amazing feature to have.
It seems that .*gtest
can't match GoogleTest(gtest)
in :history
, I'm not sure whether I use regexp match in wrong way.
PS: Can you add new separator [ ( "
like <space>
in url match ?
Any progress on this very handy feature?
This would be a great feature to improve ux.
I'm not sure what you mean by this, could you elaborate?