From 270e4c67634b8ff48c711f9f8e1c3900dcc0a34b Mon Sep 17 00:00:00 2001 From: Scott Carroll Date: Sun, 14 Dec 2025 14:05:29 +0000 Subject: [PATCH] Remove old fzf version hack --- bashprofile/.bash-profile.d/fzf-key-bindings.bash | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/bashprofile/.bash-profile.d/fzf-key-bindings.bash b/bashprofile/.bash-profile.d/fzf-key-bindings.bash index ad19f2d..dd245b2 100644 --- a/bashprofile/.bash-profile.d/fzf-key-bindings.bash +++ b/bashprofile/.bash-profile.d/fzf-key-bindings.bash @@ -49,19 +49,10 @@ __fzf_cd__() { dir=$(set +o pipefail; eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd)) && printf 'builtin cd -- %q' "$dir" } -# scottc hack - make 22.04 fzf work -if fzf --help | grep -q "\-\-scheme" -then - SCHEME='--scheme=history' -else - SCHEME='' -fi -# end scottc hack - if command -v perl > /dev/null; then __fzf_history__() { local output opts script - opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. $SCHEME --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0" + opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0" script='BEGIN { getc; $/ = "\n\t"; $HISTCOUNT = $ENV{last_hist} + 1 } s/^[ *]//; print $HISTCOUNT - $. . "\t$_" if !$seen{$_}++' output=$( set +o pipefail @@ -85,7 +76,7 @@ else # awk - fallback for POSIX systems IFS=' .' read n x y z d <<< $(command mawk -W version 2> /dev/null) [[ $n == mawk ]] && (( d >= 20230302 && (x *1000 +y) *1000 +z >= 1003004 )) && __fzf_awk=mawk fi - opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. $SCHEME --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0" + opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0" [[ $(HISTTIMEFORMAT='' builtin history 1) =~ [[:digit:]]+ ]] # how many history entries script='function P(b) { ++n; sub(/^[ *]/, "", b); if (!seen[b]++) { printf "%d\t%s%c", '$((BASH_REMATCH + 1))' - n, b, 0 } } NR==1 { b = substr($0, 2); next }