Define fzf configuration for ZSH only if available.

This commit is contained in:
Jeremy Gardais 2017-12-15 11:33:40 +01:00
parent 5955ac6b4b
commit 4b17151fea
1 changed files with 15 additions and 0 deletions

15
zshrc
View File

@ -705,6 +705,20 @@ function translate()
} }
## fzf ## fzf
if [ -d ~/.fzf ]; then
# Setup fzf
# ---------
if [[ ! "$PATH" == *$HOME/.fzf/bin* ]]; then
export PATH="$PATH:$HOME/.fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "$HOME/.fzf/shell/completion.zsh" 2> /dev/null
# Key bindings
# ------------
source "$HOME/.fzf/shell/key-bindings.zsh"
# ff - cd to selected directory (exclude hidden directories # ff - cd to selected directory (exclude hidden directories
ff() { ff() {
@ -763,6 +777,7 @@ cf() {
fi fi
} }
fi
################################################ ################################################
# 2. Prompt et définition des touches basiques # # 2. Prompt et définition des touches basiques #