Hey everyone,
Many of us use the same core plugins across multiple Obsidian vaults. Managing these individually (installing, updating) can be repetitive. I’m proposing a feature for global plugin installation to share plugin code, while ensuring configurations remain unique to each vault.
Here’s the concept:
1. Global Plugin Directory
- A user-designated folder (e.g.,
~/Documents/ObsidianVaults/.obsidian-plugins/
) would store the plugin code files (main.js
,manifest.json
, etc.).- This location should be easily syncable (e.g., with Syncthing).
- Crucially: Plugin settings (
data.json
) would always stay within each vault’s local.obsidian/plugins/plugin-id/
folder. This keeps configurations vault-specific.
2. Vault Opt-in
- Vaults would have a setting (e.g., “Enable Global Plugins”) to use this system.
3. How It Works: Loading & Cleanup
When “Enable Global Plugins” is active for a vault:
- Initial Transition (One-Time Process):
- The first time this is enabled for a vault, Obsidian scans for plugins present both locally and in the global directory.
- For any such duplicate:
- The global plugin’s code becomes the active source for the vault.
- It uses the existing local
data.json
configuration from that vault. - The local plugin code files (e.g.,
main.js
) are removed from the vault to avoid redundancy, leaving only thedata.json
.
- A notification could summarize these changes.
- Ongoing Plugin Loading:
- If a plugin’s code is in the global directory, that code is loaded, using the vault’s local
data.json
for settings. - If a plugin only exists locally (no global version), it loads as usual from the vault.
- If a plugin’s code is in the global directory, that code is loaded, using the vault’s local
- UI: The “Community Plugins” list should clearly show if a plugin is loaded globally or locally.
Key Benefits:
- Reduces Duplication: Single source for common plugin code.
- Easier Setup: New vaults quickly get standard plugins.
- Simplified Updates: Update global plugins once for all linked vaults.
- Preserves Vault-Specific Settings: Configurations remain unique.
- Sync-Friendly: Global plugin folder can be synced across devices.
Future Considerations:
- Clear user documentation will be important.
- Advanced options for overriding global plugins locally could be explored later.
This approach aims to streamline plugin management significantly for those with multiple vaults.
What are your thoughts?
Thanks,
Sam Greenwood