From d7e66d3e5c273d5bc9953085a3a9dc311f53a6b9 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Wed, 10 Mar 2021 00:57:10 +0800 Subject: [PATCH] [Search history] preview command using bat (#134) This gives the command fish syntax highlighting. --- functions/__fzf_search_history.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/__fzf_search_history.fish b/functions/__fzf_search_history.fish index baf5ecb9..e59e412c 100644 --- a/functions/__fzf_search_history.fish +++ b/functions/__fzf_search_history.fish @@ -6,7 +6,7 @@ function __fzf_search_history --description "Search command history. Replace the builtin history --null --show-time="%m-%d %H:%M:%S | " | fzf --read0 --tiebreak=index --query=(commandline) \ # preview current command in a window at the bottom 3 lines tall - --preview="echo {4..}" \ + --preview="echo -- {4..} | bat --plain --color=always --language=fish" \ --preview-window="bottom:3:wrap" | string collect )