diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index 41e707e..b87deca 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -51,7 +51,7 @@ __fzf_history__() ( shopt -u nocaseglob nocasematch line=$( HISTTIMEFORMAT= history | - $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS | + eval "$(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS" | \grep '^ *[0-9]') && if [[ $- =~ H ]]; then sed 's/^ *\([0-9]*\)\** .*/!\1/' <<< "$line" diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index a173b12..f77e7ec 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -39,7 +39,7 @@ bindkey '\ec' fzf-cd-widget fzf-history-widget() { local selected num setopt localoptions noglobsubst - selected=( $(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r ${=FZF_CTRL_R_OPTS} -q "${LBUFFER//$/\\$}") ) + selected=( $(fc -l 1 | eval "$(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS -q ${(q)LBUFFER}") ) if [ -n "$selected" ]; then num=$selected[1] if [ -n "$num" ]; then