WebDevelopersNotes logo

home-icon Home / How Do I / How do I change TextEdit to a plain text editor for HTML files?

How do I change TextEdit to a plain text editor for HTML files?

Mac TextEdit - save files in plain text format

Call me old school, but I feel all budding web developers should know how to write HTML (and CSS, Javascript etc.). Even though creating web sites has become really simple nowadays with tons of WYSIWYG tools, WordPress’s visual and other such editors, it’s always a good idea to learn things from scratch so that you have a strong foundation in your field.

Windows users have their trusted Notepad – a program I had used all these years to write HTML. On the Mac there is TextEdit.

Sponsored Links

However, by default, TextEdit opens and saves files in rich-text format. In this post, I shall detail how one can change the app settings so that it becomes a plain text editor, quite like Notepad of Windows.

How to open and save plain text files in TextEdit

  1. Launch TextEdit
  2. Open “Preferences”. Here you’ll find two tabs – “New Document” and “Open and Save”.
  3. Under the “New Document” tab, select the “Plain text” radio button.
    Check option of Plain Text
  4. Now move to the “Open and Save” tab and put a check mark at the “Display HTML files as HTML code instead of formatted text” box.
    Check option to display HTML files as HTML code instead of formatted text
  5. Close the Preferences window.
  6. Quit TextEdit completely. You can use the Command + Q keyboard shortcut.
  7. Launch the app once again to get a barebones editor. You’ll notice that there is no rich-text toolbar at the top and the font is monospace.

By the way, on my Macbook, the font used for plain text is Menlo Regular at point size 11. If you’ve shifted from Windows (like me) and want the familiar Courier (or Courier New), select it from Preferences… and you can even change the font size.

How to use TextEdit as an HTML editor

Once you’ve set up TextEdit to save and open plain text files, you can start coding HTML. However, here are a few points to note.

  • When you save an HTML file, make sure you provide the extension – .html or .htm. On my Macbook, TextEdit will supply .txt as the file extension by default if none is provided.
  • Files saved as HTML will be associated with the web browser (Safari, by default). To edit the file once again, you need to right-click, select “Open With” and choose TextEdit from the options.

Finally, once you are tired of using TextEdit for HTML or simply find it cumbersome, there are plenty of great applications available (and some of them for free) to write and edit code.

Sponsored Links

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

Don't believe everything you read on the Internet

Sponsored Links

Tips

How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]

Fact

Sony, the Japan electronics giant, was the first company to make transistor radios with all components being made in-house. The TR-55 had 5 transistors and printed circuit boards. [more...]

We use cookies to give you the best possible website experience. By using WebDevelopersNotes.com, you agree to our Privacy Policy