From 75f675b79462ecb457d04ecb586abd47dbae5883 Mon Sep 17 00:00:00 2001 From: Lapo Luchini Date: Mon, 19 Jul 2021 09:53:14 +0200 Subject: [PATCH] Add "matching" to README README was linking to #matching but was not defined. Adapt content from man-page to README. --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index d504a24..423d32c 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,21 @@ Be sure to set these before calling `zoxide init`. - When set to `1`, `z` will resolve symlinks before adding directories to the database. +## Matching + +zoxide uses a simple, predictable algorithm for resolving queries: + +* All matching is case-insensitive. + `zoxide query foo` matches `/foo` as well as `/FOO`. +* All terms must be present (including slashes) within the path, in order. + `zoxide query fo ba` matches `/foo/bar`, but not `/bar/foo`. + `zoxide query fo / ba` matches `/foo/bar`, but not `/foobar`. +* The last component of the last keyword must match the last component of the path. + `zoxide query bar` matches `/foo/bar`, but not `/bar/foo`. + `zoxide query foo/bar` (last component: `bar`) matches `/foo/bar`, but not `/foo/bar/baz`. +* The path must exist. Deleted directories are filtered out. +* Matches are returned in descending order of **FRECENCY**. + ## Third-party integrations - [`nnn`][nnn] is a terminal file manager. You can use `zoxide` for navigation