From a96dc1aa418b66054e3e3715b6d2095b29fdeea7 Mon Sep 17 00:00:00 2001 From: Aiden Ghim Date: Sat, 4 Apr 2026 18:00:49 +0900 Subject: [PATCH 1/5] Add _ZO_FZF_OPTS_FILE environment variable zoxide now recognizes `_ZO_FZF_OPTS_FILE` environment variable, in addition to `_ZO_FZF_OPTS`. --- src/cmd/query.rs | 5 +++++ src/config.rs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/cmd/query.rs b/src/cmd/query.rs index 6539c2e..1b9f86e 100644 --- a/src/cmd/query.rs +++ b/src/cmd/query.rs @@ -92,6 +92,11 @@ impl Query { fn get_fzf() -> Result { let mut fzf = Fzf::new()?; + + if let Some(fzf_opts_file) = config::fzf_opts_file() { + fzf.env("FZF_DEFAULT_OPTS_FILE", fzf_opts_file); + } + if let Some(fzf_opts) = config::fzf_opts() { fzf.env("FZF_DEFAULT_OPTS", fzf_opts) } else { diff --git a/src/config.rs b/src/config.rs index 0aeda5c..5c9908b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -47,6 +47,11 @@ pub fn fzf_opts() -> Option { env::var_os("_ZO_FZF_OPTS") } +pub fn fzf_opts_file() -> Option { + env::var_os("_ZO_FZF_OPTS_FILE") +} + + pub fn maxage() -> Result { env::var_os("_ZO_MAXAGE").map_or(Ok(10_000.0), |maxage| { let maxage = maxage.to_str().context("invalid unicode in _ZO_MAXAGE")?; From 404a931f170dd3887c8f29d2251728abe63750f0 Mon Sep 17 00:00:00 2001 From: Aiden Ghim Date: Sat, 4 Apr 2026 18:11:37 +0900 Subject: [PATCH 2/5] Change help page & manpage --- man/man1/zoxide.1 | 4 ++++ src/cmd/cmd.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/man/man1/zoxide.1 b/man/man1/zoxide.1 index ef1792b..2ac9ef2 100644 --- a/man/man1/zoxide.1 +++ b/man/man1/zoxide.1 @@ -92,6 +92,10 @@ to use \fBzoxide-remove\fR(1) to remove any existing entries from the database. Custom options to pass to \fBfzf\fR(1) during interactive selection. See the manpage for the full list of options. .TP +.B _ZO_FZF_OPTS_FILE +Path to file containing custom options to pass to \fBfzf\fR(1) during interactive selection. See the +manpage for the full list of options. +.TP .B _ZO_MAXAGE Configures the aging algorithm, which limits the maximum number of entries in the database. By default, this is set to 10000. diff --git a/src/cmd/cmd.rs b/src/cmd/cmd.rs index 7359786..db7be5c 100644 --- a/src/cmd/cmd.rs +++ b/src/cmd/cmd.rs @@ -26,6 +26,7 @@ https://github.com/ajeetdsouza/zoxide {tab}_ZO_ECHO {tab}Print the matched directory before navigating to it when set to 1 {tab}_ZO_EXCLUDE_DIRS {tab}List of directory globs to be excluded {tab}_ZO_FZF_OPTS {tab}Custom flags to pass to fzf +{tab}_ZO_FZF_OPTS_FILE {tab}Path to file containing custom flags to pass to fzf {tab}_ZO_MAXAGE {tab}Maximum total age after which entries start getting deleted {tab}_ZO_RESOLVE_SYMLINKS{tab}Resolve symlinks when storing paths").into_resettable() } From 393526e221b381fc6c29c40106c891b85667236c Mon Sep 17 00:00:00 2001 From: Aiden Ghim Date: Sat, 4 Apr 2026 18:16:59 +0900 Subject: [PATCH 3/5] Change CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b38fe2..29069e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- `$_ZO_FZF_OPTS_FILE` to specify configuration file for `fzf` + +### Added + - POSIX: support for non-Cygwin Windows environments (e.g. Busybox). ### Fixed From 350828212ea568d9bacc575def9a2f63f1b61069 Mon Sep 17 00:00:00 2001 From: Aiden Ghim Date: Sat, 4 Apr 2026 19:04:22 +0900 Subject: [PATCH 4/5] Rustfmt check --- src/config.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 5c9908b..d3e46f7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -51,7 +51,6 @@ pub fn fzf_opts_file() -> Option { env::var_os("_ZO_FZF_OPTS_FILE") } - pub fn maxage() -> Result { env::var_os("_ZO_MAXAGE").map_or(Ok(10_000.0), |maxage| { let maxage = maxage.to_str().context("invalid unicode in _ZO_MAXAGE")?; From 03addcd0458bd08df7064b4fdce282dca66eb94a Mon Sep 17 00:00:00 2001 From: Aiden Ghim Date: Sat, 4 Apr 2026 19:08:46 +0900 Subject: [PATCH 5/5] Fix manpage for styling compliance --- man/man1/zoxide.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/man1/zoxide.1 b/man/man1/zoxide.1 index 2ac9ef2..742c44c 100644 --- a/man/man1/zoxide.1 +++ b/man/man1/zoxide.1 @@ -93,8 +93,8 @@ Custom options to pass to \fBfzf\fR(1) during interactive selection. See the manpage for the full list of options. .TP .B _ZO_FZF_OPTS_FILE -Path to file containing custom options to pass to \fBfzf\fR(1) during interactive selection. See the -manpage for the full list of options. +Path to file containing custom options to pass to \fBfzf\fR(1) during +interactive selection. See the manpage for the full list of options. .TP .B _ZO_MAXAGE Configures the aging algorithm, which limits the maximum number of entries in