Giter Club home page Giter Club logo

fss's Introduction

fss

is a short lua utility for lightweight daily fs search.

is not

  • find, fd: don't provide powerful options or search speed
  • grep, rg: use extremely plain parsing rules, limited for only daily usage
  • fzf: lightweight and no interaction, you should know what you want, just lazy

intro

  • fss: search paths with patterns, and print to stdout
  • fop: read stdin line by line and open with arg[1]

setup

install via luarocks

luarocks install fss

clone and manually install

git clone [email protected]:LighghtEeloo/fss.git
cd fss
sudo luarocks make

customize by yourself

# config
CONFIG=$(HOME)/.config/fss
mkdir $CONFIG && cd $CONFIG
touch rc.lua

in rc.lua:

-- write three functions according to the rc manual below.
return {
    noticeable = noticeable,
    expandable = expandable,
    depth_limit = depth_limit,
}

man

note {} means repeat 0 or any times, | means either.

usage:  fss <PATTERNS> <PATH>{ <PATH>}
where:  <PATH>     ::= / | /<name>{/<name>} | <name>{/<name>}
        <PATTERNS> ::= <PATTERN>{,<PATTERN>}
        <PATTERN>  ::= <cstr>{.<cstr>}
        <cstr>     ::= <consecutive str>
        <name>     ::= <file name>
      
means:  given a group of patterns, 
        use each pattern to search in all paths recursively;
        and output the combined results in stdout.
      
 also:  if one path already satisfies, its children will not be included
      
 e.g.:  X.482.H    :   1 pattern, which finds Xpace/EECS-482/Homeworks
 e.g.:  Xp.e.482.H :   1 pattern, does the same
 e.g.:  Xe.482.H   :   1 pattern, but fails the prev search
 e.g.:  X.482.H,Y  :   2 patterns, find [<prev search>, Yggdrasill]
                       but no more children under Yggdrasill

rc

  • depth_limit: given depth returns whether the depth excceeds limit; stops search if true
  • noticeable : given (dirpath, item_name), returns whether the item will appear in search memo and ready for a match
  • expandable : given (dirpath, item_name), returns whether the item needs to be recursively searched; the item must be noticeable

deps

normally one won't need these. Luarocks should have taken care of these

Penlight is the battery for lua, like std for C++ and Rust or core for OCaml.

luarocks install penlight

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.