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 button in the sidebar, or File → Open in the menu bar.
  • 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 .txt on 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 system menu under File → Open Recent.
  • 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.

The Save button
Save
Idle
Up to date.
Save
Saving
Writing the file.
Save
Saved
Confirmed; fades back to idle.
  • SCtrlSSave
  • SCtrlSSave As

Save As is also available from the dropdown next to the Save button. 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.

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.

A clean vs dirty tab
notes.md×
Clean
No unsaved changes.
notes.md×
Dirty
Has unsaved changes.

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.

The conflict dialog
notes.md changed on disk
The file was modified outside Slate while you had unsaved edits. Choose which version to keep.
  • 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 you have opened recently and exposes them through the system menu under File → Open Recent. The list uses each platform's native facility, so it integrates with the dock or jump list as well.

To clear the list, choose File → Open Recent → Clear Recent.

The command palette also shows your open tabs and recent files as soon as you open it with an empty query, so it doubles as a quick recent-files menu.