Skip to main content

Working with a folder

As well as single files, Twain can open a whole folder as a project, giving you a file tree in the sidebar and full-text search across it.

A Pro feature

Folder mode is part of Twain Pro. Opening single files is free.

Opening a folder

  • File ▸ Open Folder… (⇧⌘O), or
  • Open a Folder… on the welcome screen, or
  • Drag a folder onto the window.

The folder appears in the sidebar with its name as the section header.

What the tree shows

The tree lists Markdown and MDX files (.md, .markdown, .mdown, .mkd, .mkdn, .mdx), organised by subfolder. To keep it focused on documentation, it:

  • Skips common build and dependency folders such as node_modules, .git, dist, build, .next, vendor, target, and similar.
  • Skips hidden files.
  • Hides empty folders, so a subfolder with no Markdown in it does not clutter the tree.

The scanner descends at most ten levels below the folder you opened, so files nested deeper than that are neither listed nor searched.

Folders are listed before files, each sorted by name. The file you are currently viewing is shown in bold. Click any file to open it.

The contextual menu

Right-clicking any row in the sidebar (a tree file, a folder, an open tab, or a recent) offers:

ItemWhat it does
OpenOpens the file in Twain
Open as TextOpens it in the raw source view
Open with FinderHands the file to whichever app macOS would use
Show in FinderReveals it in a Finder window
Close OthersCloses every open document except this one
Copy PathA submenu: relative, full, shell-escaped, URL, or just the file name
Quick LookDraws the Finder preview
New Text File / New FolderCreates one inside the folder, after asking for a name
Move to TrashTrashes the file, closing its tab first

A new file or folder name containing a path separator is refused, so nothing is created outside the folder named in the prompt. Every item works the same in both editions.

Keeping the tree current

The tree does not refresh automatically when files change on disk. Use Rescan folder (the refresh button in the folder header) to pick up new, renamed, or deleted files. Close folder removes the project from the sidebar.

The open folder is not remembered between launches, so open it again next time you start Twain.