preview not working on neovim 0.5 on windows 10 with fzf

2.7k Views Asked by At

i'm running neovim 0.5 with fzf-vim on windows 10 and can't seem to make preview to work.

my init.vim per below:

call plug#begin('~/AppData/Local/nvim/plugged')

    Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
    Plug 'junegunn/fzf.vim'
call plug#end()

let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.9 } }
let $FZF_DEFAULT_OPTS="--ansi --preview-window 'right:60%' --layout reverse --margin=1,4"

Error msg i got when previewing files using :Files or :Rg command: /mnt/c/Users/XXXXX/AppData/Local/nvim/plugged/fzf.vim/bin/preview.sh: line 2: $'\r': command not found
/mnt/c/Users/XXXXX/AppData/Local/nvim/plugged/fzf.vim/bin/preview.sh: line 5: $'\r': command not found
/mnt/c/Users/XXXXX/AppData/Local/nvim/plugged/fzf.vim/bin/preview.sh: line 40: syntax error near unexpected token /mnt/c/Users/XXXXX/AppData/Local/nvim/plugged/fzf.vim/bin/preview.sh: line 40: ` elif [ -n "$MSWINHOME" ]; then

have confirmed that bash.exe from c:\Program Files\Git\bin\ is in PATH.

2

There are 2 best solutions below

2
On BEST ANSWER
  1. Install Git for Windows if you haven't already installed it.

  2. Add the following line to your init.vim file.

    let $PATH = "C:\\Program Files\\Git\\usr\\bin;" . $PATH

  3. Save and Reload NeoVim.

0
On

i solved it adding "C:\Program Files\Git\usr\bin" to the PATH environment variable in Windows 10