From f64404af553982754174c543d56b229e84720722 Mon Sep 17 00:00:00 2001 From: johannst Date: Sun, 8 Mar 2020 12:24:07 +0100 Subject: zsh added fzf loader --- zshrc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/zshrc b/zshrc index 8f320eb..f5d1e70 100644 --- a/zshrc +++ b/zshrc @@ -272,4 +272,30 @@ function disableCmdTime() { # need to do after compinit zshPlug 'zsh-users/zsh-syntax-highlighting' +# fzf +function load_fzf() { + [[ $- == *i* ]] || return + + local fzf_dir=( + /usr/share/fzf + $FZF_BASE + $FZF_BASE/shell + ) + + local found=0 + for dir in $fzf_dir; do + [[ -f $dir/key-bindings.zsh ]] && { + source "$dir/key-bindings.zsh" + source "$dir/completion.zsh" + found=1 + break + } + done + [[ $found == 0 ]] && echo "[WARN]: Failed to setup fzf, try setting FZF_BASE" +} + +if which fzf &> /dev/null; then + load_fzf +fi + #% vim:et:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1 -- cgit v1.2.3