dotfiles/.local/bin/fzf-fd
2024-05-26 10:53:40 +05:00

37 lines
722 B
Bash
Executable File

#!/bin/sh
dwmc setlayoutex 2
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 \
--height=100% \
--keep-right \
--layout=reverse \
--scheme=path \
--multi --color=16 \
--preview=\"[[ -n {1} ]] && $preview\" \
--preview-window='bottom,60%,border-top' \
--scrollbar='▐' --info=inline-right \
--margin=5%,10%,5%,10% --border=none \
--prompt='  ' --pointer=' ' --ellipsis='' "
eval "$fd_command" | eval "$fzf_command"
dwmc setlayoutex 0
exit 0