This is closely related to a solution to another question of mine: How to invoke Windows' gvim in a Windows environment from within Cygwin?
I've now found that giving explorer.exe 'C:\Program Files (x86)\Vim\vim73\gvim.exe'
in the Cygwin command-line opens Windows' gVim in a Windows context properly. I've written a gvim
function in my .bashrc that executes the above command when called without arguments. However, I'd like to know how I can pass on the arguments to the gVim if the function is called with arguments. Trying explorer.exe 'C:\Program Files (x86)\Vim\vim73\gvim.exe' D:\myfile.txt
just opens Windows Explorer to the Libraries page, so this direct syntax doesn't work, but I'm unable to find what the correct way to pass these arguments is.
Googling only gives me the list of switches to explorer.exe but nothing about passing arguments to executables executed with explorer.exe.
Edit: Please note that I'm running this from Cygwin, and I've tried many of the more straightforward solutions before landing on using explorer.exe
, as documented in the question linked at the top. cygstart
and cmd.exe /c
both leave remnants of the Cygwin environment within the opened gVim, which causes some issues as mentioned there.
start
? I think its entire purpose in life is to do what you're trying to coax Explorer into doing.start
are you referring to? Cygwin doesn't seem to know a command calledstart
, how do I use it?start
command from the Windows command-prompt. Obviously that’s not going to work from the cygwin command-prompt, but you should be able to make it work as I will demonstrate in a moment below…'C:\Program Files (x86)\Vim\vim73\gvim.exe' D:\myfile.txt
(i.e. leave off theexplorer.exe
. Alternatively, trycmd.exe 'C:\Program Files (x86)\Vim\vim73\gvim.exe' D:\myfile.txt
.