mirror of
https://github.com/avinal/dotfiles.git
synced 2026-07-03 23:20:07 +05:30
c2786c7f96
- move older config to archive Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
27 lines
727 B
Bash
Executable File
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
|