If you’re involved in web development, you know how handy the View Source option is in any browser. You also know that it can be really handy to copy and paste that source code into an editor. In Firefox, that’s a two-step process: Open the Page Source view (Command-U) and then copy and paste the text from there to whatever editor you use. But it turns out there’s a way to remove one of the steps from that process, and have the code open in the editor itself when you view the source.

To do this, enter about:config in Firefox’s URL bar and then accept the warning when prompted. In the Filter box, type source.editor. That will show you three variables. Double-click on view_source.editor.external first and change its value to true. Then double-click on view_source.editor.path. That will drop down a small sheet in which you can enter the path to your preferred editor. That path must be a complete Unix-style path, and point to the actual executable (not the app bundle). For example, if you wanted to specify Coda as your default editor, the path would be /Applications/Coda.app/Contents/MacOS/Coda.

For BBEdit, you’d need to point to the command-line version of the program (/usr/local/bin/bbedit). You’d obviously need to have installed those command-line tools first; if you haven’t, go to BBEdit > Install Command Line Tools. Other editors should work; just dig into the bundle to find the name of the executable (Control-click to summon the Finder’s contextual menu, and then select Show Package Contents). Click OK to dismiss the sheet, and you’re done.

From now on, Command-U should open the page source in your chosen editor. If it fails, the code will just open directly in Firefox. To revert to the original behaviour for ?-U, just open about:config again and set view_source.editor.external back to false.