diff options
author | johannst <johannes.stoelp@gmail.com> | 2020-03-08 12:24:07 +0100 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2020-03-08 12:24:07 +0100 |
commit | f64404af553982754174c543d56b229e84720722 (patch) | |
tree | 991f85a5ef27771a8514df19652f6554b7d2b0af /zshrc | |
parent | 8ec4b79cf57f731a77be8a92e0ea9fb3171df535 (diff) | |
download | dotfiles-f64404af553982754174c543d56b229e84720722.tar.gz dotfiles-f64404af553982754174c543d56b229e84720722.zip |
zsh added fzf loader
Diffstat (limited to 'zshrc')
-rw-r--r-- | zshrc | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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 |