Remember view mode per file

Obsidian has a feature to set the default view mode - you can set it to “edit” when you frequently edit content, or to “view” when you more frequently just browse and view content.

However, my usage is mixed. There are some files which I usually only view, and others where I constantly edit. It would be great if Obsidian could somehow remember the last view mode for each file individually.

36 Likes

+1 I would love this feature. My most common workflow is that I reference evergreen notes or MOCs in view mode and use them to follow links. I follow the links to sub-notes which I am still writing so they are in the editing process.

4 Likes

The information could be formulated in YAML front-matter e.g. as one of the following:
obsidian-ui-mode: editor
obsidian-ui-mode: render
obsidian-ui-mode: live # wysiwyg

Then it could be either ignored or respected by toggle in some Plug-in.
Files without this specified would behave as they do now.

Edit: reformulated in separate request: Defaut Edit/Preview mode per file in YAML front matter - #2 by malecjan

6 Likes

+1 to this! Not familiar with YAML front matter, so feel it would be really useful.

1 Like

+1 to this request!

For example, I’m using the Dataview plugin to generate tables for tasks and I’d like to be in view mode for that file and stay in edit mode for my notes. Now I have to switch between the modes, which is not the best experience.

3 Likes

Hey. I’ve been playing around this this and I’m still not quite sure how to use it?

Do I just copy and paste one of those things at the top with with — above and below?

Thanks so much!

+1 Per-note Editor vs Preview mode with YAML specification would be really great!

1 Like

@Bhume My post above is only suggestion of possible implementation of original request. It is not implemented yet so it does not work.


Edit 2022-09-20: It has been implemented as a plugin: GitHub - bwydoogh/obsidian-force-view-mode-of-note


YAML front-matter in Obsidian is documented here: YAML front matter - Obsidian Help
For more detailed introduction to YAML format see Learn yaml in Y Minutes

I’ve built a plug-in for this; will have a look to publish it as community plug-in. As suggested above: it analyzes the YAML to decide whether to display the file in PREVIEW or EDITOR mode, regardless of Obsidian’s default setting. Think of notes serving as a dashboard (and containing dataview or tasks as code blocks).

To be continued.

This

always renders, when opening or navigating to that note as follows:

5 Likes

awesome! looking forward to try it.

Would love to give this a try as well!

I came to the forums today looking for this exact feature. Looking forward to it as well :slight_smile:

Hi. Submitted a pull request: see Add obsidian-view-mode-by-frontmatter to plugin list by bwydoogh · Pull Request #411 · obsidianmd/obsidian-releases · GitHub.
Fingers crossed :slight_smile:.

1 Like

Sweet, I recently requested this…

3 Likes

Can we call the plugin Hydra?

Any joy getting this plugin published?

1 Like

+1 I hope the plugin gets approved.
I personally would like an extended version. Like locking a whole folder, or applying the lock according to certain filters/search.

This is already on my TO-DO list (setting which takes folders containing notes which should always open in a certain mode).

1 Like

I am still waiting for approval; it takes some time apparently (all remarks made by the reviewer were addressed).

1 Like

Btw, someone on a similar thread brought up that the switch can’t be in the YAML, how would you edit the frontmatter if the note was locked in Preview Mode.

Of course, you could edit the actual file in your OS, but the idea is to stay in Obsidian.