From 8eb436ec1283db71f322da97c4abb6f365c380c4 Mon Sep 17 00:00:00 2001 From: doubleyouticky Date: Sun, 13 Dec 2020 06:50:20 +0100 Subject: [PATCH] Update __fzf_search_current_dir.fish It will solve "unknown file types in __fzf_preview_file". It wasn't working because the current directory (see pwd output in __fzf_preview_file function) of the preview context is $HOME (I don't know why ... I just spent 3 hours debugging it). To understand why I removed the colors: https://github.com/sharkdp/bat/issues/448#issuecomment-558070500 Thank you for your work. --- functions/__fzf_search_current_dir.fish | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions/__fzf_search_current_dir.fish b/functions/__fzf_search_current_dir.fish index cbbcfd4f..0ac7aadc 100644 --- a/functions/__fzf_search_current_dir.fish +++ b/functions/__fzf_search_current_dir.fish @@ -2,9 +2,10 @@ function __fzf_search_current_dir --description "Search the current directory us # Make sure that fzf uses fish to execute __fzf_preview_file. # See similar comment in __fzf_search_shell_variables.fish. set --local --export SHELL (command --search fish) + set current_dir (pwd) set file_paths_selected ( - fd --hidden --follow --color=always --exclude=.git 2>/dev/null | - fzf --multi --ansi --preview='__fzf_preview_file {}' + fd --hidden --follow --color=never --exclude=.git 2>/dev/null | + fzf --multi --preview "__fzf_preview_file $current_dir/{}" ) if test $status -eq 0