Opening certain files defaults to certain modes

Use case or problem

I have certain files that I always want to default to opening in Preview mode instead of Edit mode.

As an example, I may have a file that is used as a springboard into other content (inbox, home file, MOC, something with dataview) and I want to have that file always open in Preview mode by default.

A more specific example:

I’m using dataview to roll up linked pages in certain topic pages, so I do very little editing in the topic but I may want to use it to jump off into a different note, so rather than being in Edit view and switching to Preview, I’d like that specific file to open in Preview and other files open in Edit mode.

Proposed solution

A few options:

  • A yaml property?
  • I’d settle for a “view-modes” file that let you put the path to the note and what view you’d want for it (ie [[my-preview-note]]: preview)

Current workaround (optional)

opening a new pane for files that are preview based and trying to always open the files that are preview only in that pane.

Related feature requests (optional)

cc @EleanorKonik (from Discord)


+1 similar to dataview example, I would like to always use Preview mode when opening files that contain queries for Tasks plugin.

This feature would indeed be very helpful. For notes mainly containing queries, e.g., those for Dataview, Tasks, official Obsidian queries, etc., it may not be very useful to open them in edit mode by default, considering the fact that those notes are mostly used for querying other notes.

Known from @EleanorKonik 's excellent Obsidian Roundup post 2021-08-14: Highlights Syncing & a Minimal Editor GUI, the following Obsidian plugin is able to achieve this purpose:

One can set obsidianUIMode: source or obsidianUIMode: preview in the front matter to open a note in edit or preview mode by default.