Emacs is a powerful text editor and is a great code editor for nearly any language. It has a steep learning curve, but it is very powerful once you learn it.
If you have a UNIX based system, chances are emacs is installed already. If you don't, here are some places to look:
Source code for most UNIX machines - ftp://ftp.gnu.org/gnu/emacs
Windows binaries - ftp://ftp.gnu.org/gnu/windows/emacs/
A non-terminal emacs for OS X - http://mindlube.com/products/emacs/index.html
Emacs Wiki - http://www.emacswiki.org/cgi-bin/wiki