Skip to content

cgag/selecth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a port of Gary Bernhardt's Selecta from Ruby to Haskell. Selecta a fuzzy text selector in the vein of CtrlP or Command-T, but is an editor independant unix tool that can filter anything from stdin.

See Selecta's README for keybindings, suggested uses, the scoring algorithm, and other info. If you can read Ruby, you should probably go read the source as well, it's beautiful and a great example of the principles Gary teaches in his destroy all software screencasts in a real project.

Installation

If you're on a x86_64 bit processor, you can download the binary from github: https://github.com/cgag/selecth/releases

Then just place it on your path and you're good to go. See Selecta's readme for more on how to do this if you don't know how.

Differences from Selecta

  • Selecth calls "stty sane" to restore your terminal from raw mode, rather than setting it to its previous state. This hasn't been a problem for me, I don't imagine it will be for you, but fixing this is on my TODO list.
  • It's a native executable with no Ruby dependency.
  • It uses relative positioning rather than always placing your cursor at the bottom of the window after use.
  • Selecth is faster (3-6x), particularly for searching thousands of lines
    • Haskell's single threaded performance is solid, but it will score searches of more than 1000 lines in parallel.
    • Checkout this beautiful report generated by Bryan O'Sullivan amazing Criterion.
    • Selecta's times for the same benchmarks on my machine:
      • non-matching: 0.003015629
      • matching exactly: 0.028580932
      • matching broken up: 0.029262051
      • overlapping matches: 0.087831839
      • words, non-matching: 0.192346901
      • words, matching: 0.20814989

About

A CLI fuzzy filter in Haskell (port of Selecta)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages