fzf.vim icon indicating copy to clipboard operation
fzf.vim copied to clipboard

Error with :GFiles

Open latkins opened this issue 5 years ago • 19 comments

  • Category
    • [x] Question
    • [x] Bug
    • [ ] Suggestion
  • OS
    • [x] Linux
    • [ ] macOS
    • [ ] Windows
    • [ ] Etc.
  • Vim
    • [ ] Vim
    • [x] Neovim

I'm encountering an odd problem, and don't know how to proceed. I've installed fzf with the following:

  Plug 'junegunn/fzf', { 'dir': $HOME.'/.fzf', 'do': './install --all' }
  Plug 'junegunn/fzf.vim'

Everything works correctly, except :GFiles. When I run :GFiles from a git repo, I get:

Error detected while processing function fzf#vim#gitfiles[6]..<SNR>103_fzf[18]..fzf#run[64]..<SNR>27_execute_term[73]..<SNR>27_dopopd:      
line   20:                                                                                                                                  
E716: Key not present in Dictionary: dir                                                                                                    
E15: Invalid expression: s:fzf_getcwd() ==# w:fzf_pushd.dir                                                                                 
Error detected while processing function fzf#vim#gitfiles:                                                                                  
line    6:                                                                                                                                  
E171: Missing :endif                                                                                                                        

To make things more confusing, if I run the minimal vim configuration suggested here (vim -Nu <(curl https://gist.githubusercontent.com/junegunn/6936bf79fedd3a079aeb1dd2f3c81ef5/raw), :GFiles then works. I have tried to replicated this by removing everything except the lines relating to fzf from my configuration, but still get the same error.

Any suggestion what to look at next would be appreciated!

latkins avatar Sep 02 '18 08:09 latkins

I have the same issue for some repo's. but it worked for others.

tcoopman avatar Sep 26 '18 21:09 tcoopman

I get the same error after applying this setting :set shellcmdflag=-ci

I'd like to use these flags for zsh so it reads my zshrc file when running a command in the neovim terminal.

jmolero avatar Nov 30 '18 08:11 jmolero

I had the same problem after I switched to the fish shell. Putting set shell /usr/bin/zsh (or /usr/bin/bash) into my .vimrc fixed this

tom-anders avatar Dec 31 '18 15:12 tom-anders

has any echo in your fish config? remove that echo may be resolve the problem

sun617 avatar Jul 17 '19 15:07 sun617

It started happening for me, but only for tmux sessions. Else it works fine. Only on GFiles, everything else works.

panosl avatar Sep 30 '19 08:09 panosl

I have the same problem in windows. I am using powershell to launch neovim

Screenshot_10

nerdpad avatar Oct 03 '19 20:10 nerdpad

Getting the same issue on macos catalina, fish shell and neovim

Error detected while processing function fzf#vim#gitfiles[6]..<SNR>100_fzf[18]..fzf#run[64]..<SNR>19_execute_term[73]
..<SNR>19_dopopd:
line   20:
E716: Key not present in Dictionary: dir && (!&autochdir || w:fzf_pushd.bufname ==# bufname(''))
E15: Invalid expression: s:fzf_getcwd() ==# w:fzf_pushd.dir && (!&autochdir || w:fzf_pushd.bufname ==# bufname(''))
Error detected while processing function fzf#vim#gitfiles:
line    6:
E171: Missing :endif

edit - @tom-anders answer solved my issue

cwahlfeldt avatar Oct 24 '19 20:10 cwahlfeldt

Had the same issue (Obarun Linux, zsh, neovim). It was caused by the stty -ixon stty -ixof settings in my zshenv file. After disabling them the :GFiles command works as expected.

gsax avatar May 09 '20 16:05 gsax

Was this solved? Or any one have an advice?

Johnleegy avatar May 26 '20 13:05 Johnleegy

I have the same issue even with :Files on macOS Catalina. No idea what is causing it… I tried an empty zshrc, within tmux, not within tmux, with Terminal.app, with kitty, with alacritty… Any help would be greatly appreciated. Even when removing EVERYTHING except vim-plug and fzf in my init.vim it doesn't work. The minimal configuration does work. It is very confusing.

Edit: I just realized that I tried the minimal configuration with vim and not nvim. Running the minimal configuration with nvim does have the same problem.

strayer avatar Oct 06 '20 08:10 strayer

I also have this problem but only if I'm opening files in one specific directory in my project. I'm using Vim 8.2 on Arch.

FatBoyXPC avatar Oct 14 '20 04:10 FatBoyXPC

same here, but for me it used to work for long and suddenly at some points it stopped working :/

bmorashad avatar Dec 23 '20 06:12 bmorashad

experiencing the same with fish shell, neovim and tmux.

rajashekar007 avatar Jan 20 '21 17:01 rajashekar007

For me this issue happened after installing nvm (node version manager) by fisher, after removing nvm this bug disappeared. For reference: this is the plugin I installed.

gi4c0 avatar Jan 31 '21 16:01 gi4c0

For me this issue happened after installing nvm (node version manager) by fisher, after removing nvm this bug disappeared.

Nopes, it doesn't work for me, only works on vim but not in neovim, I even tried bash shell still the problem exist

bmorashad avatar Feb 01 '21 17:02 bmorashad

I had the same issue and fixed it by running npm install -g neovim. Was missing the neovim provider when using :checkhealth. Not sure why though, it was working but it stopped after I installed an npm package.

chinleung avatar Feb 16 '21 18:02 chinleung

I had an error message when I opened a new terminal (something missing in my .zshrc), once fixed the issue disappeared. I didn’t noticed for some time that the two were related.

haroun avatar May 18 '21 05:05 haroun

I had the same problem after I switched to the fish shell. Putting set shell /usr/bin/zsh (or /usr/bin/bash) into my .vimrc fixed this

This is what worked for me. I am using fish and had set shell=fish in my init.vim. I changed it to set shell=zsh and it works now.

Elmer-Almeida avatar Mar 26 '22 02:03 Elmer-Almeida

I had an error in my .config/fish/config.fish that caused these symtoms. When I fixed my config.fish, fzf went back to working without problems.

kaddkaka avatar Apr 09 '22 07:04 kaddkaka