From bc7c268c160377ef4b83de47c572fbc6e62e8238 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 21 Feb 2023 19:53:31 +0100 Subject: [PATCH] zshrc: fool-proof fzf bindings loading --- .zshrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index b1e77f2..cfab7a5 100644 --- a/.zshrc +++ b/.zshrc @@ -121,7 +121,14 @@ export FZF_CTRL_T_OPTS="--preview 'exa -al --group --group-directories-first --colour-scale --list-dirs --icons --git --time-style=full-iso {}' --bind '?:preview:bat --style=numbers --color=always --line-range :200 {}'" export FZF_ALT_C_OPTS="--preview 'exa -al --group --group-directories-first --colour-scale --icons --git --time-style=full-iso {}' --bind '?:preview:exa -al --group --group-directories-first --colour-scale --list-dirs --icons --git --time-style=full-iso {}'" - zvm_after_init_commands+=('[ -f /usr/share/fzf/shell/key-bindings.zsh ] && source /usr/share/fzf/shell/key-bindings.zsh') + if [[ "$(hostnamectl hostname)" == "leo" ]]; then + local fzf_bindings="/usr/share/fzf/key-bindings.zsh" + else + local fzf_bindings="/usr/share/fzf/shell/key-bindings.zsh" + fi + zvm_after_init_commands+=("[ -f $fzf_bindings ] && source $fzf_bindings") + unset fzf_bindings + # User configuration source ~/.dotenv