1995eaton / chromium-vim

Vim bindings for Google Chrome.
https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh
MIT License
2.25k stars 325 forks source link

fuzzy search history, bookmarks and open tabs #91

Open mohitleo9 opened 10 years ago

1995eaton commented 9 years ago

I'm not sure what you mean by this, could you elaborate?

JindrichPilar commented 9 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.

  1. Exact match (exact string is there)
  2. Match of the regexp mentioned above
  3. Match with different order
  4. Match without some of the words

I might make PR, but I don't have much time this month.

1995eaton commented 9 years ago

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?

JindrichPilar commented 9 years ago

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/
perpen commented 9 years ago

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.

waynehoover commented 9 years ago

This would be an amazing feature to have.

hiberabyss commented 8 years ago

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 ?

dumblob commented 8 years ago

Any progress on this very handy feature?

kurtontheway commented 6 years ago

This would be a great feature to improve ux.