Preview show File not found when a file is not in project root folder on win10 with wsl and bat not work
- Dominant language
- Vim Script
- Stars
- 10.3k
- Forks
- 608
- Avg merge
- 5d 8h
- Merged PRs (30d)
- 2
Description
- [x] I have read through https://github.com/junegunn/fzf.vim/blob/master/README.md
- [x] I have read through https://github.com/junegunn/fzf/blob/master/README-VIM.md
- [ ] I have read through the manual page of fzf (`man fzf`)
- [x] I have searched through the existing issues
minimum mrc:
set nocompatible hidden laststatus=2
if !filereadable(expand("$HOME/.vim/plug/autoload/plug.vim"))
silent execute "!mkdir " . expand("$HOME/.vim/plug")
silent execute "!git clone https://github.com/junegunn/vim-plug --depth=1 " . expand("$HOME/.vim/plug/autoload")
endif
let &runtimepath .= ',' . expand("$HOME/.vim/plug")
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
call plug#end()
autocmd VimEnter * PlugClean! | PlugUpdate --sync
steps1 . Open gvim -u test.vim
steps2. :Files
symptom1:

workaround:
modify preview.sh (line25):
FILE="${FILE/#\~\//$HOME/}"
FILE="${FILE//$'\\'/'/'}" #add
if [ ! -r "$FILE" ]; then
echo "File not found ${FILE}"
exit 1
fi
symptom2:
Doesn't use bat.
In wsl, enter "sudo apt install bat". The bat is called batcat.
workaround:
modify preview.sh (line56):
if [ -z "$FZF_PREVIEW_COMMAND" ] && command -v batcat > /dev/null; then
batcat --style="${BAT_STYLE:-numbers}" --color=always --pager=never \
--line-range=$FIRST:$LAST --highlight-line=$CENTER "$FILE"
exit $?
fi
Any suggestions?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.