Fixed fzf_hist

This commit is contained in:
Anthony Cicchetti 2019-09-22 14:54:32 -04:00
parent 9b7b09183c
commit 7409c6bf73

View file

@ -155,7 +155,13 @@ else
fi
function fzf_hist() {
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -r 's/ *[0-9]*\*? *//' | sed -r 's/\\/\\\\/g')
local sed_cmd
if [[ $(uname -s) == "Darwin" ]]; then
sed_cmd=(sed -E)
else
sed_cmd=(sed -r)
fi
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | $sed_cmd 's/ *[0-9]*\*? *//' | $sed_cmd 's/\\/\\\\/g')
}
bindkey -s "\C-r" "\eifzf_hist\n"