mirror of
https://github.com/jochenbernard/obsidian-view-mode-rules.git
synced 2026-07-22 06:54:40 +00:00
No description
* chore: prep repo for community.obsidian.md submission flow Wires up eslint-plugin-obsidianmd (the same rule set the new automated review pipeline uses) as `npm run lint` and a CI step, and rewrites the submission section of docs/PUBLISHING.md to point at the new developer dashboard instead of the deprecated obsidianmd/obsidian-releases PR workflow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: resync package-lock with package.json Regenerated to satisfy `npm ci` in CI — the prior lockfile was inconsistent (missing @types/node 25.9.1, mismatched undici-types). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .github/workflows | ||
| docs | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| CLAUDE.md | ||
| CONTRIBUTING.md | ||
| esbuild.config.mjs | ||
| eslint.config.mjs | ||
| LICENSE | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| versions.json | ||
| vitest.config.ts | ||
View Mode Rules
An Obsidian plugin that lets you set a default view (editing or reading) per note or folder, without using note frontmatter.
Features
- Set a default view on any note or folder from the file-explorer right-click menu.
- Folder rules apply to every note inside the folder; the most specific (deepest) folder wins.
- A plugin-level global default is used as a fallback, with Obsidian's built-in behavior beneath that.
- Rules survive renames and moves; rules for deleted notes are cleaned up automatically.
- Optional: re-apply configured views when navigating into already-open tabs.
- Optional: apply configured views to tabs restored at Obsidian startup.
Resolution order
When you open a note, the plugin decides which view to use in this order:
- A rule targeting that exact note.
- The deepest folder rule whose folder contains the note.
- The plugin's global default (Editing, Reading, or "Use Obsidian default").
- Obsidian's built-in default view for new tabs.
Install
From the Obsidian community plugins browser
Available once the plugin is accepted into the community directory. Submission is pending — use one of the other methods below in the meantime.
- Open
Settings → Community plugins. - Turn off Restricted mode if it is on.
- Click
Browse, search forView Mode Rules, and install. - Enable the plugin in
Settings → Community plugins.
Manual
- Download
manifest.jsonandmain.jsfrom the latest GitHub release. - Copy both files into your vault's
.obsidian/plugins/view-mode-rules/folder (create the folder if it does not exist). - Reload Obsidian and enable the plugin under
Settings → Community plugins.
Commands
View Mode Rules: Set current note to default editing viewView Mode Rules: Set current note to default reading viewView Mode Rules: Clear default view for current noteView Mode Rules: Open settings
Settings
- Global default — fallback view when no rule matches.
- Apply on workspace restore — apply rules to restored tabs at startup (off by default).
- Apply on navigation — re-apply rules when navigating into an already-open tab (on by default).
Rules are listed in two tables (note rules and folder rules). You can edit a rule's mode inline, remove it, or add new rules by path.
Scope
Only Markdown notes are affected. Non-Markdown file types (PDFs, canvases, images, etc.) are ignored by rule resolution and by the file-menu action.
Contributing
See CONTRIBUTING.md for build, test, and release instructions.
License
MIT