From 02d298a1634a9a99573d02fc1af1ee9db80b5509 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sun, 7 Sep 2025 04:49:38 +0200 Subject: [PATCH] zsh: Configure fzf It is now setup to look very similar to telescope. It now uses fd for finding files. There is a shell function `pi` to search for packages using fzf and to then install them with paru --- zsh/dot-zshrc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/zsh/dot-zshrc b/zsh/dot-zshrc index ccc58f7..b299c97 100644 --- a/zsh/dot-zshrc +++ b/zsh/dot-zshrc @@ -97,6 +97,31 @@ if hash pnpm 2>/dev/null; then esac fi +export FZF_DEFAULT_OPTS='--tmux' +export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS' + --color=fg:-1,fg+:#83a598,bg:-1,bg+:#262626 + --color=hl:bold:#8ec07c,hl+:#8ec07c,marker:#cc241d + --color=prompt:#fb4934,spinner:#af5fff,pointer:#83a598,header:#87afaf + --color=border:#7c6f64,label:#7c6f64 + --border="sharp" --border-label-pos="0" --preview-window="border-sharp" + --prompt="> " --marker="◆" --pointer=">" --separator="─" + --scrollbar="│" --info="right"' + +if hash fd 2>/dev/null; then + export FZF_DEFAULT_COMMAND="fd --type f --strip-cwd-prefix" + export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +fi +if hash fzf 2>/dev/null; then + source <(fzf --zsh) + + if hash paru 2>/dev/null; then + function pi { + paru -Slq | fzf -q "$1" --border-label="Packages" --multi --preview 'paru -Si {1} --color=always' | xargs -ro paru -S + } + fi +fi + +export _ZO_FZF_OPTS="--tmux" if hash zoxide 2>/dev/null; then eval "$(zoxide init zsh --cmd cd)" fi