From 76c63d36cc3f0b5906a6db9dbfce44788c3fbbd1 Mon Sep 17 00:00:00 2001 From: Josh Skidmore Date: Wed, 19 Aug 2020 06:08:56 -0400 Subject: [PATCH] initial commit --- README.md | 1 + zsh-fzf-history-search.zsh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 README.md create mode 100644 zsh-fzf-history-search.zsh diff --git a/README.md b/README.md new file mode 100644 index 0000000..e3334c8 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# zsh/fzf History Search \ No newline at end of file diff --git a/zsh-fzf-history-search.zsh b/zsh-fzf-history-search.zsh new file mode 100644 index 0000000..90bdaad --- /dev/null +++ b/zsh-fzf-history-search.zsh @@ -0,0 +1,8 @@ +fzf_history_seach() { + history -i 0 | fzf +s +m -x --tac -e | awk '{print substr($0, index($0, $4))}' | tr -d "\n" +} + +autoload fzf_history_seach +zle -N fzf_history_seach + +bindkey '^r' fzf_history_seach \ No newline at end of file