Automatically set the view mode (Reading, Live Preview, or Source) of notes in Obsidian based on file patterns, folder paths, or frontmatter values.
- Automatically applies a specific view mode when opening notes
- Configure view mode defaults based on:
- Folder path
- File name pattern (RegEx)
- Frontmatter metadata
- Right-click files or folders in the file explorer to lock them to Reading/Source/Live and see an icon badge inline (icons and notices are toggleable in settings).
- Supports:
reading→ Preview modesource→ Source/Markdown modelive→ Live Preview mode
- Optional settings to:
- Ignore already opened notes
- Avoid forcing view if frontmatter is missing
- Debounce view-switching to improve stability
- Show/hide file explorer lock icons
- Show/hide lock/unlock notices
When a note is opened, the plugin checks for a configured view mode in the following order:
- File pattern match (e.g. all daily notes)
- Folder rule (e.g. all notes in
Templates/) - Frontmatter field (customizable key, default is
current view) - Obsidian default view (fallback)
current view: reading # Options: reading, source, liveYou can customize the frontmatter key in the plugin settings.
Frontmatter key: Controls which frontmatter field to read (default:current view)Ignore opened files: Skips notes that were already open in the workspaceIgnore force view when not in frontmatter: Don’t override view mode unless it’s explicitly setDebounce timeout: Prevents frequent re-triggering when switching between notesFolder Rules: Apply view mode to all notes in a specific folder (context menu locks write here)File Patterns: Use RegEx patterns to match filenames or exact file locks from the context menuExplorer icons/Lock notifications: toggle UI hints and notices
- Open Obsidian and go to Settings → Community Plugins.
- Click Browse and search for “https://github.com/LucEast/obsidian-current-view”.
- Click
Add Plugin.
- Open the BRAT plugin in Obsidian.
- Search for “obsidian-current-view”.
- Click Install next to Current View.
- Download the latest release from the GitHub Releases page.
- Extract the downloaded zip into your Obsidian vault under:
.obsidian/plugins/obsidian-current-view/ - In Obsidian, go to Settings → Community Plugins, scroll down to Installed plugins, and toggle Current View on.
Clone this obsidian-current-viewsitory and run:
npm install
npm run devThis will watch your code and build to the main.js file on change.
Run tests with:
npm run test # unit tests
npm run test:watch # watch mode during development
npm run coverage # coverage via V8MIT – free to use and modify.