exit if there is no history

This commit is contained in:
Josh Skidmore
2020-08-19 06:39:46 -04:00
parent 457193c528
commit 1eb912521a

View File

@@ -1,5 +1,9 @@
fzf_history_seach() {
history -i 0 | fzf +s +m -x --tac -e | awk '{print substr($0, index($0, $4))}' | tr -d "\n"
local _history=$(history -i 0)
[[ -z "$_history" ]] && exit
echo -e "$_history"| fzf +s +m -x --tac -e | awk '{print substr($0, index($0, $4))}' | tr -d "\n"
}
autoload fzf_history_seach