r/ObsidianMD • • 13d ago

help Mac: External file open into new window?

Mac Obsidian will now open external files (from outside a Vault). I have it set as the default editor for .md files. (It's the best Markdown editor EVAR.)

Can Obsidian, or a plugin, be set so external files like that open in a new window?

I'd really appreciate the help.

(This is a repost of a really crappy original post. I apologize.)

2 Upvotes

3 comments sorted by

2

u/SZ-1F 13d ago

If you’re on Mac, having the file selected and pressing the space bar should open a read-only preview in a new window; not exactly what you’re after.

Otherwise, it might be achievable using a plugin that checks the file path.

0

u/[deleted] 12d ago

[removed] — view removed comment

2

u/SZ-1F 12d ago

this.app.workspace.getActiveFile().path; returns the path of an open file that is not within the vault. I was able to use the this.app.workspace.getLeaf('window'); and openFile() methods in the console to open an external file in a new window.

A plugin might be able to detect when a new file is opened, check the file path, and open it in a new window if it isn't in the vault. I'm not too familiar with this part of the Obsidian plugin API though, so not 100% sure if there’s a clean way to implement it.