On gvim for Windows I wanted to change the termial from cmd
to wsl
, so I added this to my gvimrc. which I got from an answer on another StackExchange site:
" Use WSL as terminal on Windows
if has("win32")
set shell=C:\Windows\Sysnative\wsl.exe
set shellpipe=|
set shellredir=>
set shellcmdflag=
endif
This works, but I get this error in gvim:
Error detected while processing BufEnter Autocommands for "*":
E484: Cannot open file C:\Users\jason\AppData\Local\Temp\VZ7302.tmp
The file name is always different and never exists at the stated location, but they do exist in C:\Users\jason\vimfiles\
like this:
jason@helios:~/winhome/vimfiles$ ls -l
.rw-r--r-- 1 0 jason jason 18 Mar 16:47 C:UsersjasonAppDataLocalTempV3F6F2F.tmp
.rw-r--r-- 1 0 jason jason 18 Mar 16:50 C:UsersjasonAppDataLocalTempV3F150C.tmp
.rw-r--r-- 1 0 jason jason 18 Mar 16:45 C:UsersjasonAppDataLocalTempV3F762C.tmp
.rw-r--r-- 1 0 jason jason 18 Mar 16:44 C:UsersjasonAppDataLocalTempV3FA146.tmp
.rw-r--r-- 1 0 jason jason 18 Mar 16:44 C:UsersjasonAppDataLocalTempV3FC5E6.tmp
.rw-r--r-- 1 0 jason jason 18 Mar 16:50 C:UsersjasonAppDataLocalTempV3FFA40.tmp
.rw-r--r-- 1 0 jason jason 18 Mar 19:53 C:UsersjasonAppDataLocalTempVZ7B35F.tmp
.rw-r--r-- 1 0 jason jason 18 Mar 19:51 C:UsersjasonAppDataLocalTempVZ7D4DA.tmp
.rw-r--r-- 1 0 jason jason 18 Mar 19:54 C:UsersjasonAppDataLocalTempVZ73D2.tmp
.rw-r--r-- 1 0 jason jason 18 Mar 19:55 C:UsersjasonAppDataLocalTempVZ74A0E.tmp
It looks like these files are being created without the backslashes, so they appear in the runtime directory instead of where they should be. How do I stop this from happening?
:set shellslash
:set verbose=5
or something. Perhaps this gives a clue what is wrong