While I agree with the large numbers of people pointing you to various versions of vim, vim also has another benefit that I haven't seen mentioned.

vim runs in a terminal window

This means that no matter what box you happen to be sitting in front of, you can always SSH to a server and run vim (with your .vimrc and ~/.vim) and it will always behave the same way (barring Weird Terminal Issues). Together with revision control, this allows you to work on code anywhere in your environment of choice setup for you.