From d5948462970a56b8dfb106e43903247b1726bb4c Mon Sep 17 00:00:00 2001 From: Josh Skidmore Date: Wed, 19 Aug 2020 08:13:18 -0400 Subject: [PATCH] initiate fzf search with $BUFFER (if available) --- zsh-fzf-history-search.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh-fzf-history-search.zsh b/zsh-fzf-history-search.zsh index 3e662b1..3a83aeb 100644 --- a/zsh-fzf-history-search.zsh +++ b/zsh-fzf-history-search.zsh @@ -1,5 +1,5 @@ fzf_history_seach() { - BUFFER=$(history -t '%Y-%m-%d %H:%M:%S' 0 | grep -v 1969 | fzf +s +m -x --tac -e | awk '{print substr($0, index($0, $4))}') + BUFFER=$(history -t '%Y-%m-%d %H:%M:%S' 0 | grep -v 1969 | fzf +s +m -x --tac -e -q "$BUFFER" | awk '{print substr($0, index($0, $4))}') zle end-of-line }