I'm using cmder as my Win7 shell. I see the following behaviour:

Works fine (file in current directory):

vim test

Works fine (absolute path):

vim ~/test

Works fine (relative path with forward slash):

vim subdir/test

Does not work fine (relative path with backward slash):

vim subdir\test

The last example flashes the following in vim:

E303: Unable to open swap file for "subdir\test", recovery impossible.

Doing :set dir shows:


which exists and is permissioned correctly (after all, I don't get errors when opening absolute path files, only relative path ones).

I suspect this might have something to do with how cmder/vim represent relative paths - maybe a forward slash/backslash issue?

  • I don't know anything about cmder but what does set shellslash? show? If you set the opposite value in your vimrc file does it help? – B Layer Nov 13 '17 at 4:21
  • How does cmder deal with path separators? The screencaps on the front page of the cmder web site show \ but looks like you are using /. – B Layer Nov 13 '17 at 4:34
  • Interesting, set shellslash doesn't show anything. However, doing vim subdir\test works fine - it's the vim subdir/test command that fails. I think it's because windows paths use \ , but cmder seems to autocomplete with /. – Henry Henrinson Nov 14 '17 at 20:28
  • Sorry, got mixed up with the slashes, I've updated the question body. – Henry Henrinson Nov 14 '17 at 20:34
  • Not :set shellslash ... :set shellslash? ... you forgot the ? and turned shellslash on. Still, try putting set shellslash (this time without the question mark) in your vimrc and see if it matters. I suspect not, though. I think you just can't use the version you have with /. – B Layer Nov 15 '17 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.