Files and Saving
Slate treats your files with care. Saves are atomic, autosave is optional, and when something changes the file on disk you stay in control of which copy wins.
Opening files
There are several ways to open a file. Pick whichever feels natural for what you are doing.
- Use the Open File or Open Folder buttons in the sidebar. They also appear on the Welcome screen when no document is open.
- Drag a file from your file manager onto the Slate window. It opens in a new tab.
- Right-click a file in your file manager and choose Open With → Slate. Slate registers itself for
.md,.markdown,.mdown,.mkd, and.txton install. - From the command line, pass the file as an argument:
slate notes.md. If Slate is already running, the file opens in the existing window rather than starting a second copy. - Open a recent file from the Welcome screen or the command palette. See Recent files below.
- Press ⌘KCtrlKcommand palette and start typing a name. The command palette searches every workspace root recursively, shows your open tabs and recent files in the empty state, and opens whichever result you choose.
To open a whole folder rather than a single file, use Open Folder in the sidebar. See Workspace and Sidebar.
Supported file types
Slate opens Markdown, plain text, and source code, and adapts to each. Knowing what is supported saves a trip to another app.
Markdown files
Full three-view experience for .md, .markdown, .mdown, .mkd, .mdx, .mdwn, .mkdn, and .markdn.
Plain text and source code
Files like .txt, .text, and any common code extension (.js, .ts, .py, .rs, and so on) open in the plain-text editor with syntax highlighting. WYSIWYG and Reading views are not available for these, since they are Markdown-specific, but everything else about the editor works the same.
Images
PNG, JPEG, GIF, WebP, SVG, BMP, ICO, and AVIF open in the dedicated image viewer. See the image viewer.
Everything else
Binary files like PDFs, Word documents, archives, and disk images appear in the sidebar but cannot be opened in Slate. Use the right tool for those.
Saving
Save the active document with the Save button in the toolbar, or with the shortcut. The button takes you through three states so you always know what just happened.
- ⌘SCtrlSSave
Save As does not have a keyboard shortcut. Reach it from the dropdown next to the Save button, or run /save-as from the command palette. Use it to write a copy of the current document to a new path, or to give an untitled document a name so it can be saved normally from then on.
The suggested name
When you first save an untitled document, Slate suggests a name based on the document itself. A Markdown document is named from its first heading, so a document that starts with # Project notes is suggested as Project notes.md. If there is no usable heading, Slate falls back to untitled.md. A document in another language defaults to untitled with that language's extension, for example untitled.ts for TypeScript. You can always change the suggested name in the dialog before saving.
Choosing an extension
The save dialog is not limited to Markdown. It offers the document's language extensions, Markdown, and an All Files option, so you can give a file any extension you like, or none at all.
Autosave
Autosave is opt-in. Turn it on from the dropdown next to the Save button. Your preference is remembered across launches.
When autosave is on, Slate writes file-backed documents about three seconds after the last keystroke. If you keep typing, it waits a little longer, but never more than about fifteen seconds at the default settings (the ceiling is configurable). Saving still works exactly the same; autosave just removes the need to remember.
The dirty indicator
When a document has unsaved changes, the tab shows a small dot to the left of the filename. The dot disappears once the file is written. If you try to close a tab while it is dirty, Slate asks whether to save first.
External changes and conflicts
Slate watches the files you have open. If something else modifies one (a terminal command, a sync tool, Git switching branches), Slate reacts based on whether you have unsaved edits in that tab.
Clean buffer
If you have not edited the file in Slate, the new contents are loaded silently. No prompt; the view just updates to match disk.
Dirty buffer
If you do have unsaved edits, Slate pauses and asks what to do. Your changes are never overwritten without your consent.
- Keep mine. Your in-Slate version wins. The file on disk is overwritten with your edits on the next save.
- Load external. Discard your edits and load the version from disk.
- Save as. Write your edits to a new file, then load the external version into the original. Useful when both versions are worth keeping.
Crash safety
Saves are atomic. Slate writes your document to a temporary file in the same folder, then renames it over the original. If the rename succeeds, the file is updated; if the system loses power during the write, the original file is untouched. You will never end up with half a file on disk.
On filesystems that do not support atomic rename across boundaries (some mounted volumes, USB drives, network shares), Slate falls back to a safe copy-then-move sequence.
Recent files
Slate tracks the files and folders you have opened recently, and surfaces them in two places.
- On the Welcome screen, the empty state shown when no document is open, you will find a list of recent files alongside a list of recent folders. Click any entry to reopen it.
- In the command palette, opened with ⌘KCtrlKcommand palette. Its empty state lists your recent files as soon as it opens, and you can also start typing to search them.