Remember view mode per file

My plug-in does not lock the note; it opens the note in the specified view mode. You are still able to switch to a different mode yourself (and edit the front matter YAML).


Glad to solve your needs.
I modified a [colorful preview] plug-in myself, and I only need to add a mark at the end of the md document to automatically enter different modes.
Add three newlines at the end to automatically enter the editing mode when you open the file.
Add three spaces at the end to automatically enter the preview mode when opening the file.ZH多彩预览 (5.4 KB)


It has been approved :+1:



A bit related, I feel the current Obsidian’s toggle pane mode option doesn’t follow principle of least surprise. And they kept changing the name of the option. If it just does the reasonable thing, I won’t need this plugin.

All this does is switch the Obsidian Edit/Preview Mode to the other mode when you click on the file with the lines or spaces. You are then in that mode for all other files.

Its great that those line/space files force the mode, but then I still have to switch back when I go to another un-space-line-modified files.

Good work around for the desperate, but not exactly the solution.

Also, it might be better if the file marking was a visible character, like ppp or eee. Or make the characters a setting.

Front matter would also be better.

Sorry for complaining.

Thank you for your advice. It feels that marking with visible characters will pollute the source text. If this is necessary, you can modify the main.js plug-in file to replace the regular expression [\n {3}] with EEE and [ ] with PPP

1 Like