GVIM on Windows: execute buffer and paths with spaces

In gVim for windows, you can execute the current buffer with the command:!%. But unfortunately, the buffer file name is supplied in cmd.exe without quotes, so if the file path has spaces, gVim will not be able to execute it.

Is it easy to fix in order to be able to execute .bat, .py, etc. from inside gVim?

+4
source share
1 answer

This is my guess, I do not have a Windows machine to try. Try

:!python "%" 

or

 :!"%" 

Credit: Eye of Hell

+1
source

All Articles