Code Monkey home page Code Monkey logo

searchy's Introduction

NOTE: At some point a change in node broke some uses of this and I'm not interested in fixing it. You're better off using fzf.

Searchy

searchy demo

Simple interactive search for Node, inspired by percol and fzf. It works as a standalone program you can put in bash pipes or as a menu for inside your own application.

Note: if you install node-migemo it will be used to make matching Japanese text easier.

Command line example

npm install -g searchy
echo -e "hsif\neip\nekac" | searchy | rev
# output will be a word spelled correctly!

Case matching uses "smartcase" like Vim; matches are not case-sensitive unless there is a capital letter in the query.

Node example

var search = require("searchy").search;

search("one two three four five six panda fish パンダ フライパン 日本語 日本橋".split(" "), function(choice){
  console.log("You picked " + choice + "! Congratulations!");
});

Useful techniques

Searchy your shell history for that command you can't quite remember by adding this to your .bashrc: (inspired by hstr)

function hh () {
  $(history | cut -c 8- | awk '!seen[$0]++' | searchy)
}
# add this line to replace the default history search:
bind -x $'"\C-r":hh'

License

WTFPL, do as you please. -POLM

searchy's People

Contributors

polm avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

searchy's Issues

directory support

When used from the command line, if there are arguments,

  1. If files, add their lines to the search
  2. if directories, add their contents to the search
  3. optionally support directory descent (selecting a directory in a directory shows contents)

For reference, fzf uses something like find . as a default command; percol shows help without input.

fix flicker

when arrows keys are pushed, only the old and current selected lines should be re-drawn

tabs make output weird

Some things that happen:

  • tabs aren't higlighted when the row is selected
  • jerky scrolling
  • all rows seem to be shifted up one, obscuring query

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.