ajeetdsouza / zoxide

A smarter cd command. Supports all major shells.
https://crates.io/crates/zoxide
MIT License
23.13k stars 555 forks source link

Doesn't work with fzf's --bind one:accept (auto-select on unique entry) #908

Closed rieje closed 1 month ago

rieje commented 1 month ago

fzf's --bind one:accept auto-selects entry when there's only one match (run echo 'a' | fzf --bind one:accept and it won't show the interactive prompt). It doesn't seem to have any effect--launching __zoxide_zi and inputting a 'downloads' when 'downloads' is a unique entry, it doesn't get auto-selected despite being the only match. Same goes with --zoxide_zi downloads--fzf displays only one match but it doesn't get auto-selected.

_ZO_FZF_OPTS='--bind one:accept'
eval "$(zoxide init --no-cmd zsh)"
alias z='__zoxide_zi'
ajeetdsouza commented 1 month ago

Try --select-1 instead.

rieje commented 1 month ago

Same behavior, get prompted with fzf on unique entry instead of jumping straight to it. fzf version 0.55.0.

_ZO_FZF_OPTS='--select-1'
eval "$(zoxide init --no-cmd zsh)"
alias z='__zoxide_zi'

# 'downloads' is the only entry from z
z downloads
ajeetdsouza commented 1 month ago
_ZO_FZF_OPTS='--select-1'

You're setting a shell variable. The syntax for setting environment variables is different:

export _ZO_FZF_OPTS='--select-1'