Releases: natecraddock/zf
0.10.2
0.10.1
A small bugfix release to fix the keybindings so that ctrl-p moves the selection up
- Fixed by @joshdpark in #67 (their first contribution)
Additionally:
- adds libVaxis as a lazyDependency by @OndraVoves in #66 (their first contribution)
- adds Void Linux install instruction by @tranzystorekk in #65
Thanks for the contributions!
zf 0.10.0
This release adds support for an fzf inspired --preview
option, updates the Zig module API, and rewrites the UI to use libvaxis.
Preview
The --preview
option can be used to run a command for the currently selected line. The stdout of the command is collected and displayed in a preview window on the right. {}
characters in the command will be substituted with the current line.
The --preview-width
option can be used to set the width of the preview window as a percent. Values from 20% to 80% are accepted, with or without the percent sign.
As an example
fd -tf | zf --preview 'cat {}'
will pipe a list of files to zf
and use cat
to display the contents of the currently selected file on the right of the window.
Zig Module API
Zf can be used as a Zig module to add fuzzy matching to your project. The API was simplified in this release.
Rather than accept boolean parameters, the options are now in a struct passed to the function.
This means
zf.rank(string, token, false, false);
zf.rank(string, token, false, true);
Is now written as
zf.rank(string, token, .{});
zf.rank(string, token, .{ .plain = true });
This makes the default case simpler, and also makes the boolean parameters clear at the call site.
The case_sensitive
parameter was also named to to_lower
for more clarity. See the library docs for more information.
Other Changes
- The UI was completely rewritten to use libvaxis instead of my own custom terminal rendering code.
- The env variable
ZF_PROMPT
no longer supports terminal escape sequences. It was difficult to support this when rewriting to use libvaxis. Support for this feature may return in the future if there is interest. - Adds an option to
zig build
to compile as a PIE executable. This should be useful for package mainainers. Usezig build -Dpie
to enable this option- This was contributed by @tranzystorekk (their first contribution) in #64. Thanks!
- Zf no longer does unicode normalization of the input.
zf 0.9.2
This release supports both Zig 0.12.1 and 0.13.0.
No changes since the last release. Just tagging a new version so package managers can build with the newest releases of Zig.
zf 0.9.1
zf 0.9.0
This is a smaller release. The main goal of this is to have a stable version of zf that targets Zig 0.11.0. There are also improvements to support the new Zig package manager, refactorings, and small fixes.
I originally planned to include a UI preview feature in this release, but I ran into some issues with in release builds and I haven't had time to debug properly. So that will be postponed until the next release of zf. But a lot of refactoring and code to support a UI preview is already included in this release.
And although this news is months old, zf is now available in nix.
See the changelog for full details.
zf 0.8.0
zf 0.7.0
The headline feature of this release is strict path matching, another way that zf is optimized for filtering filepaths with accuracy and precision.
With strict path matching, when a query token contains a /
character, any other characters after the slash must appear in a single path segment. As an example, the query /foo
would match /foo/bar/
but not /fo/obar
because the characters "foo"
must appear in a single path segment.
This is useful for narrowing down results when you know the exact path structure of your files. As a more complex example, with the following paths
app/models/foo/bar/baz.rb
app/models/foo/bar-baz.rb
app/models/foo-bar-baz.rb
app/monsters/dungeon/foo/bar/baz.rb
The query a/m/f/b/baz
filters to only app/models/foo/bar/baz.rb
whereas in previous versions of zf the string app/monsters/dungeon/foo/bar/baz.rb
is also included in the results. To end strict path matching, just add a space to start a new token.
This release also includes many fixes, refactors, optimizations, unicode support, and a few other small features.
See the changelog for more details.
zf 0.6.0
This release is focused on small optimizations, refactors, and using zf as a library. Because zf is now packaged as a Zig library, it makes sense to switch back to semantic versioning which makes this version 0.6.0 rather than 0.6. This release also updates the source code to support Zig 0.10.0.
While refactoring zf to be more easily consumed by a library, I designed the library to require zero allocations and be passed external slices of memory. Alongside this I also added a restriction to zf as a cli tool. The number of space-separated tokens in the query is now limited to 16. This seems like a safe upper limit, but can be raised if needed.
See the changelog for more details.