Files
dotfiles/.local/bin/hx-pick
T
avinal c2786c7f96 feat: major update to all configs
- move older config to archive

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-03-26 12:11:58 +05:30

27 lines
727 B
Bash
Executable File

#!/usr/bin/env bash
# hx-pick: loop between file picker and helix
# Select a file -> edit in helix -> back to picker on exit
# Press Esc/Ctrl-C in the picker to drop to a normal shell
dir="${1:-.}"
cd "$dir" || exit 1
while true; do
file=$(find . -type f \
-not -path './.git/*' \
-not -path '*/node_modules/*' \
-not -path '*/vendor/*' \
-not -path '*/__pycache__/*' \
-not -path '*/target/*' \
-not -path '*/.build/*' \
| sort \
| fzf --height=100% --layout=reverse --border=rounded \
--prompt="Edit > " \
--header="Esc to exit to shell" \
--preview='head -100 {}' \
--preview-window=right:50%:wrap)
[ -z "$file" ] && break
hx "$file"
done