From 94b77ffd0ec5f7c606e12f72e7ec66c89ed7ddea Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Mon, 7 Dec 2020 19:59:05 -0500 Subject: [PATCH] fzf: extract separator --- fish/conf.d/fzf.fish | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fish/conf.d/fzf.fish b/fish/conf.d/fzf.fish index 12059e0..f14fc82 100644 --- a/fish/conf.d/fzf.fish +++ b/fish/conf.d/fzf.fish @@ -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