diff --git a/bash/fzf b/bash/fzf index ec8b8fd..07b683e 100644 --- a/bash/fzf +++ b/bash/fzf @@ -1,6 +1,8 @@ # shellcheck shell=bash # vim: ft=sh +if type fzf 1>/dev/null 2>/dev/null; then + __fzf_select__() { 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 \ -o -type f -print \ @@ -54,3 +56,5 @@ fi bind '"\C-r": " \C-e\C-u`__fzf_history__`\e\C-e\e^\er"' bind '"\ec": " \C-e\C-u`__fzf_cd__`\e\C-e\er\C-m"' + +fi diff --git a/zsh/fzf b/zsh/fzf index 7064611..5e6b1dc 100644 --- a/zsh/fzf +++ b/zsh/fzf @@ -1,6 +1,7 @@ # Key bindings # ------------ if [[ $- == *i* ]]; then +if type fzf 1>/dev/null 2>/dev/null; then # CTRL-T - Paste the selected file path(s) into the command line __fsel() { @@ -76,3 +77,4 @@ zle -N fzf-history-widget bindkey '^R' fzf-history-widget fi +fi