How-to

How to Edit a Text File on a Mac Without Opening Another App

Updated November 9, 2026

A .txt file is the simplest kind of note. To fix one line you should not have to open another app, find the file again and come back. In ComfortFiles you type in it right in the preview panel.

Change the text

  1. Select the text file. The preview panel (⇧⌘P) shows it.
  2. Click where you want to change something, and type.
  3. Save and Revert appear under the text as soon as something changed. Click Save, or press ⌘S.

Revert forgets every change since the last save, and ⌘Z undoes the last one. If you select another file, close the window or quit with changes not yet saved, ComfortFiles asks first.

Find a word

Type in the field above the text. Every match is highlighted and the first is selected, and the count beside the field says which one you are on, for example 2 of 7. Press Return for the next match and ⇧Return for the one before. Upper and lower case and accents do not matter.

What stays exactly as it was

  • The encoding. UTF-8 with or without a BOM, UTF-16, Windows Cyrillic and Western, and Shift JIS. A file read and saved without a change is byte for byte the same file.
  • The line breaks. A file from Windows keeps its line breaks, and a line you add, or text you paste, gets the same kind.
  • Your characters. Straight quotes stay straight and -- stays two hyphens: nothing is replaced or corrected as you type.
  • The file itself. Saving writes the new file beside the old one and then swaps them, so a crash halfway leaves the old file whole. Its tags, permissions and creation date stay.

If another app changes the file while you are editing it, a line under the text says so, with Reload and Keep Editing, and saving asks before replacing the other app’s changes.

If you type something the file’s encoding cannot hold, such as an emoji in a Windows Cyrillic file, ComfortFiles says so instead of saving a broken file.

The same is in the menu when you right-click the text: How editing text files works opens this page. For tables saved as text, see How to edit a CSV file.

Frequently asked questions

How do I edit a .txt file on a Mac without opening TextEdit?

Select the file in ComfortFiles. The preview panel (⇧⌘P) shows its text. Click into it and type. Save appears under the text as soon as something changed; click it or press ⌘S.

Will saving change a text file that came from Windows?

No more than you changed it. The file keeps its encoding, including the Windows Cyrillic and Western ones and Japanese Shift JIS, and its Windows line breaks. A line you add gets a Windows line break too.

Why do my quotes stay straight?

On purpose. Smart quotes, dashes, text replacements and spelling corrections are off in a plain text file, so it gets exactly the characters you typed.

Why can I not type in my text file?

A short line under the text says why. A file larger than 10 MB can be read but not changed here, and so can a file you have no permission to change. Files over 20 MB, and files that are not really text, are shown by macOS’s own preview.