Execute current file in Vim
Here’s a helpful function you can drop in to your .vimrc that binds F5 to execute the current file if it has a shebang.
You’ll need to make sure the file is executable. A similar tip was posted the other day on the Daily Vim blog.