From 7826e5fb314ebd7628432d0bcb924027df5f04d3 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 13 Mar 2024 12:45:50 +0100 Subject: [PATCH] Fix fzf key-bindings --- zshrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 254b19c..3392a8b 100644 --- a/zshrc +++ b/zshrc @@ -2071,12 +2071,14 @@ fi ## }}} autoload is-at-least +# FZF_DEFAULT_OPTS according to fzf version {{{ if is-at-least 0.29.0 $(fzf --version); then export FZF_DEFAULT_OPTS="--cycle --multi --select-1 --bind 'change:first,shift-tab:down,tab:up'" else ## change:first is unknown in FZF before 0.29.0 export FZF_DEFAULT_OPTS="--cycle --multi --select-1 --bind 'tab:down,shift-tab:up'" fi +# }}} # Auto-completion # --------------- @@ -2084,7 +2086,8 @@ fi # Key bindings # ------------ -source "${HOME}/.fzf/shell/key-bindings.zsh" +test -f "${HOME}/.fzf/shell/key-bindings.zsh" && source "${HOME}/.fzf/shell/key-bindings.zsh" +test -f "/usr/share/fzf/key-bindings.zsh" && source "/usr/share/fzf/key-bindings.zsh" # ff - cd to selected directory exclude hidden directories and their content {{{ # Search with find (fd|fdfind overkill the CPU for few benefits on small tree)