dotfiles/.local/bin/fzf-fd

32 lines
664 B
Plaintext
Raw Normal View History

2024-04-23 04:34:15 +02:00
#!/bin/sh
search_dir="${1:-.}"
preview='bat --style=header,numbers --color=always {}'
fd_command="fd . \
--type file \
--hidden \
--follow \
--color always \
--exclude .git \
--exclude .github \
--exclude *.o \
--exclude *.pyc \
--full-path \"$search_dir\""
fzf_command="fzf \
--ansi \
2024-05-18 10:41:08 +02:00
--height=100% \
--keep-right \
2024-04-23 04:34:15 +02:00
--layout=reverse \
2024-05-18 10:41:08 +02:00
--scheme=path \
2024-04-23 04:34:15 +02:00
--multi \
--preview=\"[[ -n {1} ]] && $preview\" \
2024-05-18 10:41:08 +02:00
--preview-window='bottom,60%,border-top' \
--scrollbar='▐' --info=hidden \
--margin=5%,10%,5%,10% --border=none \
--prompt='  ' --pointer=' ' --ellipsis='' "
2024-04-23 04:34:15 +02:00
eval "$fd_command" | eval "$fzf_command"
exit 0