From 927415e25fdc8d8635c0a29dffbe978423b92779 Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Thu, 10 Apr 2025 20:15:05 +0200 Subject: [PATCH] update fzf for darwin --- .chezmoitemplates/fzf-bash_darwin.tmpl | 12 +++--------- .chezmoitemplates/fzf-zsh_darwin.tmpl | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.chezmoitemplates/fzf-bash_darwin.tmpl b/.chezmoitemplates/fzf-bash_darwin.tmpl index ebf72a7..8226a23 100644 --- a/.chezmoitemplates/fzf-bash_darwin.tmpl +++ b/.chezmoitemplates/fzf-bash_darwin.tmpl @@ -1,13 +1,7 @@ # Setup fzf # --------- -if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then - PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin" +if [[ ! "$PATH" == *{{ .chezmoi.homeDir }}/.fzf/bin* ]]; then + PATH="${PATH:+${PATH}:}{{ .chezmoi.homeDir }}/.fzf/bin" fi -# Auto-completion -# --------------- -[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.bash" 2> /dev/null - -# Key bindings -# ------------ -source "/opt/homebrew/opt/fzf/shell/key-bindings.bash" +eval "$(fzf --bash)" diff --git a/.chezmoitemplates/fzf-zsh_darwin.tmpl b/.chezmoitemplates/fzf-zsh_darwin.tmpl index be24395..f73f116 100644 --- a/.chezmoitemplates/fzf-zsh_darwin.tmpl +++ b/.chezmoitemplates/fzf-zsh_darwin.tmpl @@ -1,13 +1,7 @@ # Setup fzf # --------- -if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then - PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin" +if [[ ! "$PATH" == *{{ .chezmoi.homeDir }}/.fzf/bin* ]]; then + PATH="${PATH:+${PATH}:}{{ .chezmoi.homeDir }}/.fzf/bin" fi -# Auto-completion -# --------------- -[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null - -# Key bindings -# ------------ -source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh" +source <(fzf --zsh)