This is really short and can most likely be found in a million different places online. Well, now the count is up to a million and one.
You want to set the EDITOR environment variable for Terminal.app on Mac OS X? You’re puzzled that there’s (possibly) no .profile or .bash_profile in your home directory? You are distressed, scared, and disoriented because you don’t know where to put your environment variables? Alas! Thou shalt wonder no more!
Just run this in your Terminal.app:
open /Developer/Applications/Utilities/Property\ List\ Editor.app ~/.MacOSX/environment.plist
(This assumes that you have the XCode development tools installed. If you don’t just use vi and edit the XML file by hand. I also assume that you have a .MacOSX subdirectory in your home folder which contains an environment.plist file)
You will be greeted with something like this:
set | grep EDITOR