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.
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:
| Item | What it does |
|---|---|
| Open | Opens the file in Twain |
| Open as Text | Opens it in the raw source view |
| Open with Finder | Hands the file to whichever app macOS would use |
| Show in Finder | Reveals it in a Finder window |
| Close Others | Closes every open document except this one |
| Copy Path | A submenu: relative, full, shell-escaped, URL, or just the file name |
| Quick Look | Draws the Finder preview |
| New Text File / New Folder | Creates one inside the folder, after asking for a name |
| Move to Trash | Trashes 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.