Skip to content

gpanders/fzy.zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fzy.zig

Rewrite of John Hawthorn's excellent fzy in Zig.

See Usage for notable differences from the original.

Project Status

This repo is experimental and its primary purpose is for experimentation and/or fun. Please abandon any expectations of this being a serious project.

Building

Zig 0.11.0 is required. To clone and build, run:

$ git clone https://git.sr.ht/~gpanders/fzy.zig
$ cd fzy.zig
$ zig build

This will build an fzy binary in zig-out/bin/. To install to a different prefix, use the -p flag:

$ zig build -p ~/.local

By default, fzy.zig is built in Debug mode. This is very slow. If you intend to actually use fzy, you should compile in either ReleaseSafe or ReleaseFast mode:

$ zig build -Doptimize=ReleaseSafe

Usage

Usage is the same as the original fzy except for the following:

  • Input is read concurrently with key events from the user. This means you can start typing your query right away rather than waiting for fzy to read the entire candidate list. This is especially noticeable when the input stream is slow.

  • Multi-select support: press Ctrl-T to select multiple items.

  • A -f/--file flag allows you to read input from a file:

    fzy -f input.txt
    

    This can of course also be done by just piping the file in over stdin:

    fzy < input.txt
    
  • A -n/--no-sort flag that prevents fzy from sorting matches.

Contributing

Questions, bugs, and patches can be sent to the mailing list.

License

MIT

About

Rewrite of fzy in Zig (mirror)

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages