Executing your code from Vim

My girlfriend is currently learning Python, and using Vim as her text editor (because she’s a boss). She told me this morning that she was quitting Vim to run her code each time she changed it, which was becoming annoying. I showed her a couple of methods to do this and thought I’d quickly document it for her and others. We both run Macs, and run Vim from Terminal/iTerm, but this should at least point you in the right direction if you’re running a different OS. Also, the examples below use Python, but should work equally well for similar scripting environments like Perl or Ruby.

Continue reading