refactor(bin): rename dev script to tf and add a zoxide mode

This commit is contained in:
Sergio Laín 2025-06-11 13:53:27 +02:00
parent 0d497156cc
commit e5c3f5f230
No known key found for this signature in database
GPG key ID: 51BB28D8B42FB438
2 changed files with 10 additions and 3 deletions

View file

@ -59,7 +59,7 @@ bind -r "<" swap-window -d -t -1
bind -r ">" swap-window -d -t +1 bind -r ">" swap-window -d -t +1
# Projects # Projects
bind-key Enter popup -E -h 80% -w 80% "dev" bind-key Enter popup -E -h 80% -w 80% "tf"
# Switch from Notes/Tasks Session with last session # Switch from Notes/Tasks Session with last session
bind-key n run "tmux-notes-switch" bind-key n run "tmux-notes-switch"

View file

@ -6,6 +6,7 @@ ls="eza --header --icons --all --color=always --group-directories-first --hyperl
projects_dir="$HOME/dev" projects_dir="$HOME/dev"
projects_command="find $projects_dir -mindepth 2 -maxdepth 2 -type d" projects_command="find $projects_dir -mindepth 2 -maxdepth 2 -type d"
fzf_command="fzf --height=100%" fzf_command="fzf --height=100%"
zoxide_command="zoxide query -l"
yaml_config() { yaml_config() {
local yaml_file="$1" local yaml_file="$1"
@ -70,8 +71,14 @@ launch_docs() {
fi fi
} }
selected_dir=$($projects_command | $fzf_command --prompt='Select a directory: ' \ selected_dir=$(
--preview "$gfetch {} && $ls {} || $ls {}") $projects_command | $fzf_command \
--prompt='Select a directory: ' \
--bind "ctrl-r:reload($projects_command)+change-preview($gfetch {} && $ls {})" \
--bind "ctrl-z:reload($zoxide_command)+change-preview($ls {})" \
--header "ctrl-r: repos | ctrl-z: zoxide" \
--preview "$gfetch {} && $ls {}"
)
tab_title=$(basename "$selected_dir") tab_title=$(basename "$selected_dir")