If you want RHEL5, you have to buy a license from Red Hat. They gave up on personal users a long time ago, so their licenses are moderately expensive in personal terms, although pretty good for a commercial major-league OS with support.
However, if you want something that is essentially RHEL5 without the support, go to http://centos.org, use it to locate one of the CentOS mirror sites (or, if you prefer, a vendor that will sell you pre-burned CentOS install DVDs).
CentOS is RHEL, except that you don't get Red Hat's direct support and they have replaced all logos and Red Hat references with their own logos and references due to legal restrictions.
At present, they actively support the RHEL5 and RHEL6 systems. RHEL4 (also earlier versions) is available from their legacy archives but stopped receiving fixes, updates and security patches in February 2012.
This is not a pirate OS. A lot of people who don't need the extra level of support that Red Hat provides run CentOS on their production servers. Red Hat is OK with that - they're making money hand over fist anyway, and unlike a lot of businesses, don't resent the "lost" sales.
There is no special distro of Red Hat/CentOS/Fedora specifically for use as a VM. The stock distros come with paravirtualized kernels for use with Xen, and the stand-alone kernels work on full-virtualization systems.
An IDE is no substitute for an Intelligent Developer.
If all you really want to do is try vim/emacs, any Linux distro will work for you. I've found that the Ubuntu distros run great as VMs (though the Unity interface might turn you off - it does take some getting used to). But then I also run CentOS as a VM, works great. Mint is another distro that I have run successfully as a VM.