summaryrefslogtreecommitdiff
path: root/zshrc
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2020-03-08 12:24:07 +0100
committerjohannst <johannes.stoelp@gmail.com>2020-03-08 12:24:07 +0100
commitf64404af553982754174c543d56b229e84720722 (patch)
tree991f85a5ef27771a8514df19652f6554b7d2b0af /zshrc
parent8ec4b79cf57f731a77be8a92e0ea9fb3171df535 (diff)
downloaddotfiles-f64404af553982754174c543d56b229e84720722.tar.gz
dotfiles-f64404af553982754174c543d56b229e84720722.zip
zsh added fzf loader
Diffstat (limited to 'zshrc')
-rw-r--r--zshrc26
1 files changed, 26 insertions, 0 deletions
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