Add a tmux floating-pane zoxide directory switcher
prefix+g opens the ,z zoxide+fzf picker in a floating pane (tmux 3.7
new-pane) and opens a new window named after the selected directory.
Teach ,z to skip its own `fzf --tmux` popup when IN_TMUX_FLOAT is set so
it renders directly inside the caller-provided float instead of stacking
a redundant popup. Shell usage is unchanged.
Assisted-by: Claude Opus 4.8 (claude-opus-4-8)
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
index 165e3233..e8806f5e 100644
--- a/.config/tmux/tmux.conf
+++ b/.config/tmux/tmux.conf
@@ -83,6 +83,10 @@ bind C-c new-window -c '#{pane_current_path}';
bind v split-window -h -c '#{pane_current_path}';
bind s split-window -v -c '#{pane_current_path}';
+# zoxide + fzf directory switcher in a floating pane; opens a new window
+# named after the selected dir
+bind g new-pane -x 80% -y 60% -e IN_TMUX_FLOAT=1 -- ~/.dotfiles/bin/,z;
+
## fzf-git (disabled — fzf-git.sh is no longer sourced in zsh)
# bind -Tfzf-git C-f send-keys C-g f
diff --git a/bin/,z b/bin/,z
index ed2ae1a7..80dcffa0 100755
--- a/bin/,z
+++ b/bin/,z
@@ -6,9 +6,15 @@ if [[ "${TRACE-0}" == "1" ]]; then
fi
main() {
+ # Float via fzf's own tmux popup, unless the caller already gave us a
+ # floating container (e.g. a tmux binding running this in a floating pane),
+ # where --tmux would open a redundant popup on top.
+ local tmux_opts=(--tmux "80%,60%")
+ [[ -n "${IN_TMUX_FLOAT:-}" ]] && tmux_opts=()
+
local dir
dir=$(zoxide query -l "$@" | fzf --no-multi --select-1 --no-margin --no-padding \
- --tmux 80%,60% \
+ "${tmux_opts[@]}" \
--highlight-line --info inline-right \
--border-label ' zoxide ' \
--preview 'eza --tree --color=always {}' \