dotfiles/zsh/fzf.zsh

18 lines
761 B
Bash

if [[ $(command -v fzf) ]]; then
case $(lsb_release -si) in
Gentoo) source /usr/share/zsh/site-functions/_fzf ;;
VoidLinux) source /usr/share/fzf/completion.zsh ;;
esac
source /usr/share/fzf/key-bindings.zsh
export FZF_DEFAULT_COMMAND='fd -H -L --ignore-file ~/.local/config/fd'
export FZF_CTRL_T_COMMAND='fd -H -L --ignore-file ~/.local/config/fd'
export FZF_DEFAULT_OPTS="--multi -e --ansi --layout=reverse --preview='bat --color=always --tabs=2 --style=plain --theme=Monokai\ Extended\ Bright {}'"
export FZF_CTRL_R_OPTS="-e --ansi --layout=reverse --preview=''"
_fzf_compgen_path() {
fd -H -L --ignore-file ~/.local/config/fd . "$1"
}
_fzf_compgen_dir() {
fd -H -L --ignore-file ~/.local/config/fd --type d . "$1"
}
fi