I've been working at this all morning and I still can't find a way to easily bind a key to compile my program from the Windows version of gVim using the Cygwin GCC, and then run it. I'm kind of a novice to Bash scripting, and I haven't been able to make it create the .exe in the home directory (C:/cygwin/home) and then run it.
What I have so far:
map <F4> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
exec "!gcc /home/%:t && cd C:/cygwin/home && ./a.exe"
endfun
This would work all well and good, except that when I go to the home directory, the a.exe is not there. Compiling using gcc from the bash script .bat in cygwin works fine... but not from gVim.
Thanks for all help in advance.