7

I'm looking for something similar to windows notepad. textEdit exists, but opening a *.html file with it will instantly treat the code as rich text and add a bunch of other markup to the document the moment you save.

I'm excluding terminal editors here (vi, nano, ed, etc).

textEdit can fit this purpose, but only if we rename the document to have a .txt extension before editing and then only renaming it back to .html afterward. Looking for either a setting on the software or a separate (already installed) GUI tool entirely.

1
  • 1
    Does GVim count as a GUI editor or a terminal editor in your book? ;-)
    – DevSolar
    Jun 27 at 13:47

2 Answers 2

15

You can view any HTML file in source form using the TextEdit app.

From the TextEdit User Guide:

Always open HTML files in code-editing mode

  1. In the TextEdit app on your Mac, choose TextEdit > Preferences, then click Open and Save.

  2. Select “Display HTML files as HTML code instead of formatted text”.

Follow these steps:

  1. Open the HTML file. It shows up in WYSIWYG mode by default.

  2. Open TextEdit preference, go to Open and Save tab and check Display HTML files as HTML code instead of formatted text (shown below).

    enter image description here

  3. Close and reopen the HTML file using TextEdit. You should now be able to view the file in its source form.

  4. Any HTML file opened with TextEdit moving forward would be displayed in its source form.

1
  • 1
    Nice answer. And if everyone used TextEdit to author .txt files for text-only documents instead of Word, the world would be a better place.
    – Mentalist
    Jun 27 at 13:18
-3

Not sure if Emacs counts as a terminal editor or not, considering it can be invoked as a graphical editor, if you use Xwindows.

I guess maybe similar to Gvim....although, Gvim doesn't require X.

1
  • 2
    The question asked about pre-installed editors with a GUI. Neither Gvim nor a GUI-enabled Emacs is part of macOS (neither is X11, actually).
    – nohillside
    Jun 27 at 20:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .