I'm looking for a foolproof way to edit a text file and be certain that the application or mac OS doesn't save a copy of the content, e.g. through some autosave function, or caching.

The reason being I am storing sensitive information.

The way I want to secure it is by placing the text file in an encrypted volume created and mounted with Vera Crypt. But as I did this I realized that certain text editors create autosave files.

Are there any text editors, or other ways, to ensure I don't end up leaving traces of the text file, or its content outside of the encrypted volume?

  • macOS makes snapshots of file system and memory is paged out - why aren’t you using the native security boundaries on macOS? If you don’t trust the OS this might require a lot of extra detail to answer properly.
    – bmike
    Jul 17, 2022 at 11:36

3 Answers 3


If you can, avoid using a graphical editor.

macOS is designed to help the user; graphical applications typically support auto-saving and snapshots by default – this functionality is provided by macOS for developers to use.

Instead prefer a minimal command line editor such as nano or pico.

As an aside, have you turned off the access log for the encrypted volume? See How can I stop fseventsd for certain volumes?

Additionally, if the volume appears mounted via the Finder, be sure to disable Spotlight Indexing.


Given your desire for security, you should not trust the community and assume any suggested tools are trustworthy. Instead, examine and build from source yourself:

  • pico's source is part of Alpine;
  • nano's source is part of GNU.
  • 1
    Use ed if you want to go for truely minimal :-) But are you sure that the console editors don't create temporary files? At least running strings on the binary returns some messages indicating the use of temp files (for nano, pico and ed).
    – nohillside
    Jul 16, 2022 at 9:20
  • You are right! I wondered who would be the first to suggest sed; I did not expect ed. The answer now includes source code links. Jul 16, 2022 at 18:26
  • 1
    Using sed leaves the commands in the shell history. Most likely one would need to chroot to the encrypted volume (which of course has its own challenges).
    – nohillside
    Jul 16, 2022 at 18:42
  • 1
    If you can't trust community builds the you also need the code of the C compiler as Ken Thompson showed scienceblogs.com/goodmath/2007/04/15/…
    – mmmmmm
    Jul 16, 2022 at 20:35
  • pico is a symlink to nano and has been since OS X 10.3.
    – fd0
    Jul 17, 2022 at 11:07

Depending on the level of sensitivity an app that "leaves no trace" might not be enough. Perhaps you need to consider the use of a separate machine (physical or virtual) without internet access where you do the editing of sensitive text files. Then you wouldn't need to be concerned about any cache or autosave as it all would happen in the secure environment anyway.

If the contents are less sensitive you could consider an encrypting text editor, such as DeadboltEdit (not affiliated):

Secure encrypting text editor for Mac OS X™, Windows™, and Linux™. DeadboltEdit is a basic text editor that uses strong encryption to store files.

On the topic of autosave they write:

  1. Does the Mac OS X version of DeadboltEdit support Autosave?
    No. There are no plans to implement Autosave.

BBEdit seems to do what you want.

Its a simple text editor with great features. It opens files, colors the syntax if it detects it (this doesn't change the file, it just makes the file more readable. Then, when you save the file, the text file is overwritten & the changes are saved. You can save as to save the file as a different name/directory. No autosave. No caching. The search functionality is amazing - super fast & very useful. And it is reputable, since its first release was in 1992 and its had strong reviews ever since. Just make sure to disable the default autosave setting.

Another option is to open the file via nano (super simple linux text editor) through the terminal. But this is more advanced, so I recommend BBEdit.

  • Sublime Text also works this way
    – Ezekiel
    Jul 16, 2022 at 3:37
  • 2
    I am not user of BBEdit but documentation states: "Document auto-save (for crash recovery) is on by default, with a save interval of one minute." Jul 16, 2022 at 6:54
  • 1
    @AivarPaalberg Oh, its been so long since i set it up that i forgot to tell to just disable autosave. I use it as a replacement for nano bc of the mouse support & color syntax. Jul 16, 2022 at 13:20
  • Might help to explain how autosave can be disabled.
    – nohillside
    Jul 16, 2022 at 13:31
  • 1
    Document auto-save (for crash recovery) is on by default, with a save interval of one minute. To change either setting via the terminal use: defaults write com.barebones.bbedit EnableAutoSave_v2 -bool YES and defaults write com.barebones.bbedit AutoSaveIntervalInMinutes_v2 -int 10 - taken from the BBEdit manual Jul 19, 2022 at 20:03

You must log in to answer this question.

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