summaryrefslogtreecommitdiff
path: root/zshrc
diff options
context:
space:
mode:
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