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:
Then just click on "Root" and then click on "New Child" and enter the data for your EDITOR variable so it looks something like this:
Save and quit Property List Editor.
My environment.plist file now looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/
Now you have to log out and log back in for the changes to take effect. After that you should see "EDITOR=vi" when you run
set | grep EDITOR