summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2019-07-08 16:29:00 +0200
committerFlorian Pritz <bluewind@xinu.at>2019-10-08 15:57:56 +0200
commitf8395e1081b9ab73ed59261b9b8cf842561fb198 (patch)
tree1d44c545a3e0176e3557459eee4851d7f1c66a32
parentbc7f2a4df10ea63befd9a1103cd115ccc1c6186b (diff)
downloaddotfiles-f8395e1081b9ab73ed59261b9b8cf842561fb198.tar.gz
dotfiles-f8395e1081b9ab73ed59261b9b8cf842561fb198.tar.xz
zshrc: Only use fzf when installed
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--.zshrc11
1 files 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 {{{