From b911c1b910624edc6381091b0aeb01882d9144e8 Mon Sep 17 00:00:00 2001 From: scbj Date: Fri, 28 Nov 2025 11:35:34 +0100 Subject: [PATCH] (scripts) fixed conditions to replace C-r with fzf --- scripts/fzf-bash-history.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/fzf-bash-history.sh b/scripts/fzf-bash-history.sh index d9aab56..16d1c85 100644 --- a/scripts/fzf-bash-history.sh +++ b/scripts/fzf-bash-history.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -[[ "$-" != "*i*" ]] || return - function __search-history { current_line="${READLINE_LINE}" command=($(fc -lnr 1 | fzf --scheme=history --tmux --expect=tab,right -q "${current_line}")) @@ -25,7 +23,7 @@ function __search-history { READLINE_POINT=$((0 + ${#command})) } -if command -v fzf 2>&1 >/dev/null; then +if [[ "$-" == *i* ]] && which fzf &>/dev/null; then bind -r "\C-r" bind -x '"\C-r": __search-history' fi