The GUI way
- Launch Safari
- Go to Preferences
- Go to 'Advanced' preferences
- Click 'Show develop menu in menu bar.
- launch System Preferences
- go to Keyboard preferences
- select 'Keyboard Shortcuts'
- choose 'Application Shortcuts'
- click the + button
- set Application to 'Safari'
- set the keyboard shortcut to something like ⌘ + J
The Command Line Way
If 12 steps seems like a lot of hassle, try these two (Note: Safari must not be running when you make these change)
defaults write com.apple.safari IncludeDevelopMenu 1
(That is the equivalent of the first 4 GUI actions.)
(This is the equivalent of the last 8 GUI actions.)
Note that the '@J' on the command line is equivalent to ⌘ + J. See http://www.mactipper.com/2008/02/add-keyboard-shortcuts-from-command.html for more information on adding keyboard shortcuts via Terminal.app.