At work I use neovim on Windows, and set the shell to bash using the bash executable that comes with Git for Windows (gitbash), which is in my PATH. The settings in the minimal init.vim pasted below mean that almost everything works as expected, but either reading or writing temporary files does not.
if has("win32") let &shell='bash.exe' let &shellcmdflag = '-c' let &shellredir = '>%s 2>&1' set shellquote= shellxescape= " set noshelltemp set shellxquote= let &shellpipe='2>&1| tee' endif
For example, executing
:%!cat in nvim results in:
E485: Cannot read file C:\Users\GREAF7~1.GLA\AppData\Local\Temp\nvimdVFZaL\1
If I immediately check in that directory, there is indeed no such file, so I assume writing the temp file is the issue.
If I uncomment the line
" set noshelltemp then the command described will run successfully, but this isn't a solution because plugins such as Fugitive fail with temp-file related errors.
What am I doing (or not doing) wrong?