Symptom
You expect TextEdit to open your HTML file in plain text form for editing, but it renders the file into its consumable form.
Solution
1. Open TextEdit.
2. Choose Preferences from the TextEdit application menu.
3. Click the Plain Text radio button for New Document Format.
4. Under Saving, click the checkbox to turn off "Append '.txt' extension to plain text files."
5. Under Rich text processing, click the checkbox to turn on "Ignore rich text commands in HTML files."
6. Be sure the checkbox for "Wrap to Page" is deselected (Figure 1).
Figure 1 Correct TextEdit Preferences for configuration file editing
Notes
1. Any data in TextEdit prior to taking these steps may contain rich text commands that become visible after the preference changes are made.
2. TextEdit may continue to render files saved from Web browsers as HTML Source, ignoring the preferences you have set. As a workaround (after following the steps above) view the source code in the Web browser and copy/paste the text into a new TextEdit document.