Skip to content

mdsrosa/fuzzyfinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fuzzyfinder

Build Status Gem License

Fuzzy Finder implemented in Ruby. Matches partial string entries from a list of strings. Works similar to fuzzy finder in SublimeText, Atom and Vim's Ctrl-P plugin.

How does it work

See Amjith Ramanujam's blog post describing the algorithm: http://blog.amjith.com/fuzzyfinder-in-10-lines-of-python

Installation

Add this line to your application's Gemfile:

# Add to your Gemfile
gem 'fuzzyfinder'

# or install manually
gem install fuzzyfinder

Usage

2.2.1 :001 > require 'fuzzy/finder'
 => true

2.2.1 :002 > Fuzzy::Finder.find('user', ['api_user.doc', 'user_doc.doc', 'django_migrations.py', 'migrations.py'])
 => ["user_doc.doc", "api_user.doc"]

2.2.1 :003 > Fuzzy::Finder.find('djm', ['api_user.doc', 'user_doc.doc', 'django_migrations.py', 'migrations.py'])
 => ["django_migrations.py"]

2.2.1 :004 > Fuzzy::Finder.find('mig', ['api_user.doc', 'user_doc.doc', 'django_migrations.py', 'migrations.py'])
 => ["migrations.py", "django_migrations.py"]

Contributing

  1. Fork it ( https://github.com/mdsrosa/fuzzyfinder/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Inspired by

Amjith Ramanujam's implementation

Thank you Amjith.

About

FuzzyFinder implemented in Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages