Fix fzf key-bindings

This commit is contained in:
gardouille 2024-03-13 12:45:50 +01:00
parent 9c49c7b29b
commit 7826e5fb31
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 4 additions and 1 deletions

5
zshrc
View File

@ -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)