From f8395e1081b9ab73ed59261b9b8cf842561fb198 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 8 Jul 2019 16:29:00 +0200 Subject: zshrc: Only use fzf when installed Signed-off-by: Florian Pritz --- .zshrc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.zshrc b/.zshrc index b69376f..a5154e2 100644 --- a/.zshrc +++ b/.zshrc @@ -237,9 +237,6 @@ fzf-history-widget() { typeset -f zle-line-init >/dev/null && zle zle-line-init return $ret } -zle -N fzf-history-widget -bindkey '^R' fzf-history-widget - __fsel() { local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ @@ -262,8 +259,12 @@ fzf-file-widget() { return $ret } -zle -N fzf-file-widget -bindkey '^T' fzf-file-widget +if type fzf &>/dev/null; then + zle -N fzf-history-widget + bindkey '^R' fzf-history-widget + zle -N fzf-file-widget + bindkey '^T' fzf-file-widget +fi # }}} # Variables {{{ -- cgit v1.2.3-24-g4f1b