fzy.zig
fzy.zig copied to clipboard
Rewrite of fzy in Zig (mirror)
fzy.zig
Rewrite of John Hawthorn's excellent fzy in Zig.
See Usage for notable differences from the original.
Building
Obviously building fzy.zig requires a Zig toolchain. Currently Zig master is required.
$ git clone --recursive https://github.com/gpanders/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 /usr/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 -Drelease-fast
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-Tto select multiple items. -
A
-f/--fileflag allows you to read input from a file:fzy -f input.txtThis can of course also be done by just piping the file in over stdin:
fzy < input.txt -
A
-n/--no-sortflag that preventsfzyfrom sorting matches.
License
MIT