I'm editing Unity 3D .cs files in gVim on Windows 7, I'd like when I double click a file in Unity for the file to open in an existing vim window, but instead it opens a new one.
To get around this I used various other SO answers to make a batch file and call vim using --remote-silent. This all works apart from vim acts like it wont allow remote commands to run on it.
Batch file:
@ECHO OFF
:Loop
IF "%1"=="" GOTO Continue
start "" "C:\Program Files (x86)\Vim\vim73\gvim.exe" --remote-silent ":sp %1<CR>"
SHIFT
GOTO Loop
:Continue
It gives me
":sp C:\my\path\file.cs" [Permission Denied] Press enter or type command to continue
I tried removing the "%1" to check if it was the file that was giving the permission error, but no luck. The batch file runs via a shortcut that runs as administrator (nothing is ever simple in Windows)
Unity -> Shortcut -> Batch file -> gVim -> ":sp filename"
Any ideas why vim won't let this command run?
Can't seem to find any mention of permissions in vim help -remote files or anyone else seeing this on google.
Thanks.
*Edit 1 Looks like something weird si going on, if I do :ls I see this in my buffer list
2 %a= ":sp C:\My\file\path.cs" line 1
Like its treating the whole command as the file path or something?