Turn TextEdit Into an HTML Source Viewer with a Simple Settings Change
TextEdit is a reasonably decent text editing app that has been bundled along with just about every version of OS X since the beginning. If you’ve ever opened an HTML file with TextEdit you have probably discovered the app actually renders the HTML code, displaying the formatted text, rather than displaying the source itself. This is actually really simple to adjust, and all it takes is a settings change to turn TextEdit into an HTML code viewer rather, and as a side effect, a simple plain text code editor.
Change TextEdit to Display HTML Files as Code Rather Than Rendered Formatted Text
This is available in all modern versions of OS X:
- Open TextEdit and pull down the TextEdit menu to select Preferences
- Click the “Open and Save” tab and check the box next to “Display HTML files as HTML code instead of formatted text”
Open any HTML document into TextEdit to see the new document code and source view in place of rendered code.
The default font size for plain text documents like HTML is set to 11, which can be very small for some resolutions and screens like the 11.6″ MacBook Air. Extend the readability by adjusting that through “Preferences” and under the “New Document” tab click “Change” alongside the ‘Plain text font’ option – Menlo Regular 12 is quite a bit more readable, but adjust it as your eyes see fit.
Developers will find this is infinitely better than the default rendered HTML view, but it doesn’t offer syntax highlighting and other powerful features that those who work with the web generally need. If you’re serious about viewing source or changing code of any kind, do yourself a huge favor and download TextWrangler, it is by far the best free text editor for the Mac platform, it has syntax highlighting and SFTP support along with tons of other features, and it’s completely free.
I would say SublimeText2 is BY FAR the best text editor, on ALL platforms !!
Might be a Mountain Lion specific option.
In Lion, the option is
“Display HTML files as HTML code instead of formatted text” not what you have shown.