feat: use fc instead of history

This commit is contained in:
Stefan Hojer
2021-08-31 01:29:18 +02:00
parent 54f8015e01
commit daf2367e9d

View File

@@ -1,6 +1,6 @@
fzf_history_seach() {
setopt extendedglob
candidates=(${(f)"$(history -t '%Y-%m-%d %H:%M:%S' 0| fzf +s +m -x --tac -e -q "$BUFFER")"})
candidates=(${(f)"$(fc -li -1 0 | fzf +s +m -x -e -q "$BUFFER")"})
BUFFER="${candidates[@]/(#m)*/${${(As: :)MATCH}[4,-1]}}"
BUFFER="${BUFFER[@]/(#b)(?)\\n/$match[1]
}"