Continuing along with more vi tips, these can help you out of a jam or just save you time – going back to command line, etc.
Saving a file, which is read-only? Running java, Perl, PHP from within vi.
Have you ever edited a file, made your changes only to find the file is write only? Then in zsh at least, it won't save it.
Here is a simple work around:
:!chmod u+w %
Percent is a shortcut in vi to the current file.
How about shell programming or PHP, Perl or even Java. You want to run the code, just like this:
!./%!javac %;java `echo % | sed 's/.java//'`!php -q %