krannich43 downloadsOpen files from the file explorer in a modal preview instead of in the editor.
Obsidian plugin that opens files from the file explorer in a modal preview instead of in the editor.
Settings → Community plugins → Browse → search "Tree Modal" → Install → Enable.
main.js, manifest.json and styles.css from the latest release.<vault>/.obsidian/plugins/tree-modal/.npm install
npm run dev # watch mode
npm run build # production build (minified)
For local testing, symlink the plugin folder into your vault:
ln -s "$(pwd)" <vault>/.obsidian/plugins/tree-modal
The default click handler of the file explorer is intercepted via a DOM event listener
on document in capture phase, filtered to .nav-file-title elements. preventDefault()
and stopPropagation() block the default "open in editor" behavior; Cmd/Ctrl-click and
folder clicks pass through unchanged.
The modal embeds a detached WorkspaceLeaf in markdown mode, so everything Obsidian
provides (live preview, wikilink completion, Templater, the native read/edit toggle)
keeps working inside the modal.
As a supported second path, a file-menu entry "Open in modal" is registered via the
official API, independent of the DOM structure.
data-path on .nav-file-title is not part of the official plugin API. It works
reliably today but could theoretically break with an Obsidian update. The file-menu
fallback keeps the core feature usable in that case.MIT