Why not, indeed. For me one of the interesting things about trying out a new graphical programmer’s editor is how I’m always reminded of a pledge I made years ago to just bite the bullet and become a vim master. After all, real men (and women) use vim, don’t they?
Pretty much all modern graphical programmer’s editors can do useful stuff like running the current document as a script at the command line or executing routine git commands.
Of course you can do both of those in tried and true vim as well. In fact, you can even do them in its graphical incarnation, gvim.
The key to running scripts inside vim is to first make sure that the editor will run its commands in the directory where the currently loaded file resides. That’s done by setting autochdir in .vimrc before getting started.
Executing any shell command in vim is as easy as hitting the colon key and then typing a bang (!) and the current file variable (%). If the file needs an interpreter (like a perl or python script), you should also specify the interpreter command. For example:
That’s all there is to it!