dotfiles/.local/bin/fzf-fd

55 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-04-23 04:34:15 +02:00
#!/bin/sh
2024-05-25 17:48:42 +02:00
dwmc setlayoutex 2
2024-04-23 04:34:15 +02:00
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 \
--exclude node_modules \
2024-04-23 04:34:15 +02:00
--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-07-05 08:58:36 +02:00
--multi \
2024-04-23 04:34:15 +02:00
--preview=\"[[ -n {1} ]] && $preview\" \
2024-05-18 10:41:08 +02:00
--preview-window='bottom,60%,border-top' \
2024-05-25 17:48:42 +02:00
--scrollbar='▐' --info=inline-right \
2024-05-18 10:41:08 +02:00
--margin=5%,10%,5%,10% --border=none \
2024-07-05 08:58:36 +02:00
--highlight-line \
--color=bg+:#2d3f76 \
--color=bg:#1e2030 \
--color=border:#589ed7 \
--color=fg:#c8d3f5 \
--color=gutter:#1e2030 \
--color=header:#ff966c \
--color=hl+:#65bcff \
--color=hl:#65bcff \
--color=info:#545c7e \
--color=marker:#ff007c \
--color=pointer:#ff007c \
--color=prompt:#65bcff \
--color=query:#c8d3f5:regular \
--color=scrollbar:#589ed7 \
--color=separator:#ff966c \
--color=spinner:#ff007c \
2024-05-18 10:41:08 +02:00
--prompt='  ' --pointer=' ' --ellipsis='' "
2024-04-23 04:34:15 +02:00
eval "$fd_command" | eval "$fzf_command"
2024-05-25 17:48:42 +02:00
dwmc setlayoutex 0
2024-04-23 04:34:15 +02:00
exit 0