fzf: extract separator

This commit is contained in:
Charles Gould 2020-12-07 19:59:05 -05:00
parent ccb7c5a6f2
commit 94b77ffd0e

View File

@ -35,11 +35,12 @@ function __fzf_git_log
end
function __fzf_history
set -l separator ' | '
set -l output (
history search --null --show-time="%Y-%m-%d | " |
history search --null --show-time="%Y-%m-%d$separator" |
fzf --read0 --tiebreak=index --query=(commandline) --preview='echo {}' --preview-window='bottom:50%:hidden:wrap' --bind='?:toggle-preview'
)
if set -l command (string split --max 1 " | " $output)[2..-1]
if set -l command (string split --max 1 $separator $output)[2..-1]
commandline -r $command
end
commandline -f repaint