I'm running vim // gvim 8.2 (fresh off of vim.org, and was before---just re-installed to do so as administrator, per instructions I'd missed before).

I've been getting this since getting this Windows 10 running Windows 10 + Cygwin. I also tried sending these via email to [email protected] (after joining) but both bounced, so I gather that's gone.

Ok, here's what's going on. I use !!foo a LOT, e.g., !!sort -u, !!stuff_for_calendar, etc. The problem is, I get the following instead (and nothing actually runs)---this is the version of the error in gvim (I got it working in normal vim while working through these examples):

shell returned 1

E485: Can't read file C:/Users/gamed/AppData/Local/Temp/VIolC9C.tmp

Note: /bin/zsh is /bin/zsh.exe and has permissions at 777 while working on this.

  • 1
    You are getting that no matter the shell comamnd you run? None of them should be using the Windows temp dir. What's the environment variable TMP set to? (:echo $TMP). Or actually Vim may be using that as it uses a temp file during filtering....same issue though...check envvars. And what do you have for 'shelltemp' setting? For that matter check all of the settings that start with "shell".
    – B Layer
    Commented Jan 21, 2021 at 1:34
  • $TMP in zsh is set to /cygdrive/c/Users/gamed/AppData/Local/Temp which gvim uses. Setting it (and exporting it) does nothing...still uses the above. Note that, after fixing this issue (it was a zsh permissions problem thanks to M$) in vim, it's only gvim that's messed up now.
    – GTbrewer
    Commented Jan 21, 2021 at 1:38
  • Personally, I have it set to c:\cygwin\tmp...can't remember at the moment if I did that for cosmetic reasons or for something more significant.
    – B Layer
    Commented Jan 21, 2021 at 1:39
  • Oh, and yes, no matter what shell command I run.
    – GTbrewer
    Commented Jan 21, 2021 at 1:43
  • 2
    Check your shell options. In particular, what your shell is. /bin/zsh may not be resolvable for a native windows application like windows gvim. Commented Jan 21, 2021 at 7:05

1 Answer 1


Confusing....am I sure I want to answer my question? Thanks to the comment from Christian that led me straight to the answer, I am, yes!

I did the following in a zsh window:

export SHELL=C:/cygwin64/bin/zsh.exe

That fixed it. So I'll be adding that to my ~/.zprofile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.