Skip to content

Commit

Permalink
Update __fzf_search_current_dir.fish
Browse files Browse the repository at this point in the history
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: sharkdp/bat#448 (comment)

Thank you for your work.
  • Loading branch information
doubleYouTicky authored Dec 13, 2020
1 parent 9a2ead5 commit 8eb436e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functions/__fzf_search_current_dir.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8eb436e

Please sign in to comment.