Force Read Mode
approvedby al3xw
Forces Markdown files in specified folders to open in read-only mode.
★ 16 stars↓ 3,358 downloadsUpdated 3mo agoMIT
Force Read Mode
Force Read Mode is a simple Obsidian plugin that ensures all Markdown files within specified paths are always opened in read (preview) mode. It’s useful when you want to prevent accidental edits or enforce a read-only experience for certain files.
Features
- Automatically forces read mode when opening Markdown files from specified folders.
- Supports multiple folder patterns.
- Uses powerful micromatch glob syntax.
- Simple and lightweight.
- Quickly enable or disable via the Command Palette.
- No impact on files outside the configured folders.
How It Works
- When a Markdown file is opened, the plugin checks its path.
- If the path matches a configured pattern, the file opens in read mode.
- This happens every time the file is opened.
- You can temporarily disable this behavior using a command.
How to Use
- Go to Settings → Community Plugins → Browse and install the Force Read Mode plugin.
- Enable the plugin from Settings → Community Plugins.
- Open Settings → Force Read Mode to configure:
- Add a pattern for files you want to open in read mode (one pattern per line).
- Patterns use micromatch syntax.
- Examples:
Notes/**— all files under theNotesfolder (any depth).Projects/*/*.md— Markdown files directly inside a subfolder ofProjects.**/Readme.md— allReadme.mdfiles.
- Use the Command Palette (
Ctrl+PorCmd+P) to toggle the plugin on or off with Force Read Mode: Enable or Force Read Mode: Disable.
Development
To contribute to or modify this plugin:
- Clone the repository.
- Install dependencies using
npm install. - Build the plugin with
npm run build. - Load the plugin into Obsidian for testing.
- Open a pull request with your changes.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.