zshrc: fool-proof fzf bindings loading

This commit is contained in:
leo 2023-02-21 19:53:31 +01:00
parent 8790dade9c
commit bc7c268c16
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

9
.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