Autosave Control

by Miha Smrekar
5
4
3
2
1
Score: 52/100

Description

An Obsidian plugin for overriding the default auto-save frequency.

Reviews

No reviews yet.

Stats

83
stars
5,573
downloads
3
forks
76
days
54
days
54
days
1
total PRs
0
open PRs
1
closed PRs
0
merged PRs
36
total issues
0
open issues
36
closed issues
108
commits

Latest Version

2 months ago

Changelog

Automatically created release for tag 1.0.19.

Release notes: -fix for #43 : another plugin rewriting a note directly on disk (Frontmatter Modified Date, Linter, Templater, sync clients, ...) could wipe out everything you had typed since the last save. Obsidian merges an on-disk change into an open editor only when it considers the note to have unsaved changes, and the flag it uses for that is set by the very save request this plugin holds back. So a note with pending edits looked already-saved to Obsidian: instead of merging, it silently replaced the editor's text with the version from disk, and the delayed autosave then wrote that stripped-down version back out. The plugin now keeps that flag truthful for every note it is holding, so Obsidian merges such a change exactly as it does without this plugin. -fix for #43 (second layer): the merge above is best-effort and can still drop an edit that lands in the same part of the note the other plugin rewrote, e.g. inside the frontmatter block. When another plugin uses Obsidian's read-modify-write API (the one processFrontMatter is built on), the plugin now writes the note's pending changes out first, so that plugin reads what you actually have on screen and there is nothing left to merge. This happens in Delayed Autosave mode only, one write earlier than the delay alone would have made; Autosave Disabled mode still never writes anything on your behalf and falls back to the merge. -fix: clicking out of the editor no longer postpones a pending save. Blurring the editor makes Obsidian ask for a save, and with the corrected flag above that request now reaches the plugin — it must not restart the countdown, since clicking away is not an edit. The delay stays "time since your last actual edit". -internal: added end-to-end regression tests for all three, each verified to fail without its fix — held edits surviving an external frontmatter rewrite in both save modes, the pre-flush handing the other plugin an up-to-date read, and a blur keeping the original save deadline.

README file from

Github

Obsidian Autosave Control

This plugin gives you full control over how Obsidian.md saves your notes.

By default, Obsidian saves every ~2 seconds while you type. While convenient, this behavior can cause issues such as:

  • Sync conflicts with cloud storage (e.g. Google Drive, Dropbox, Proton Drive, ...)
  • Performance problems with large files
  • Issues when working on network drives
  • Increased battery usage

This plugin allows you to change that behavior.

Modes

1. Delayed Autosave

  • You type normally.
  • The save timer resets on every edit (per file).
  • Obsidian saves once, only after you stop editing for the configured delay (by default 10 seconds).

This reduces unnecessary writes and avoids constant file updates.

2. Autosave Disabled

  • No automatic saving occurs.
  • Files are saved only when you manually trigger a save.
  • You must use the Save File command (assign a hotkey if needed).
  • Quitting Obsidian or closing its window with unsaved changes shows a warning that lists the affected notes.
  • Switching notes in a tab or closing a note tab does not prompt: your unsaved changes are kept in memory and restored when you reopen the note.
  • Hover the status-bar indicator to see the list of notes with unsaved changes.

Workspace Layout Saves

  • Obsidian also saves layout state to .obsidian/workspace.json.
  • Switching notes can update that file even when note content does not change.
  • This plugin can delay those writes too.

Status Indicator

The plugin shows save state in the status bar:

🔵 Blue — Unsaved changes pending
🟢 Green — All changes saved

Colors and the size of the icon can be customized in settings.

Settings

Save Delay

  • Defines how long Obsidian waits after you stop editing before saving
  • Only available in Delayed Autosave mode

Disable Autosave Completely

  • Turns off all automatic saving
  • Hides the delay setting
  • Requires manual saves

Defer workspace layout saves

  • Delays writes to .obsidian/workspace.json
  • Helps reduce sync activity when switching notes
  • Works independently of note autosave mode

Workspace layout save delay

  • How long to wait before writing deferred layout changes
  • Only used when Defer workspace layout saves is enabled
  • Separate from the note save delay

Saved status color

  • Status dot color when all changes are saved.

Pending status color

  • Status dot color while changes are not saved.

Status icon size

  • Size of the status bar dot in pixels.

Installation

Install from Obsidian Community Plugins directory

This plugin is available in the official Obsidian Community Plugins directory:

https://community.obsidian.md/plugins/autosave-control

  1. In Obsidian, open Settings -> Community plugins.
  2. Select Browse.
  3. Search for Autosave Control.
  4. Install the plugin.
  5. Enable the plugin.

Install with BRAT

This plugin can be installed and auto-updated with BRAT (Beta Reviewers Auto-update Tester):

  1. In Obsidian, install BRAT from Settings -> Community plugins -> Browse.
  2. Open the command palette and run BRAT: Plugins: Add a beta plugin for testing (with or without version).
  3. Enter this repository path: mihasm/obsidian-autosave-control
  4. Choose Latest version if you want BRAT to keep the plugin updated automatically.
  5. Confirm the install.

BRAT installs the plugin from this repository's GitHub releases and can update it for you later.

Manual install

  1. Download the latest release from GitHub:
    https://github.com/mihasm/obsidian-autosave-control/releases

  2. Create this folder in your vault if it does not exist: your-vault/.obsidian/plugins/autosave-control

  3. Download main.js, manifest.json, and styles.css from the release and place them in that folder.

  4. In Obsidian:

  • Open Settings → Community Plugins
  • Enable the plugin

Important Notes

  • Unsaved changes are kept in memory until written to disk.
  • If Obsidian or your system crashes before saving, changes may be lost.
  • If workspace layout deferral is enabled, recent layout state can also be lost after a crash until workspace.json is flushed.
  • Some Obsidian features and community plugins only update after a save occurs. For example, the Outline (headings) pane on the right won't reflect new headings until the autosave fires. Because this plugin delays or disables saves, expect similar lag in any feature or plugin that reacts to file writes rather than in-editor changes.
  • On mobile, force-killing Obsidian within a fraction of a second of editing can lose the last edit — a platform limitation the plugin can't fully prevent.
  • Plugins that rewrite a note directly on disk (Frontmatter Modified Date, Linter, Templater, sync clients, ...) read the file, not your editor, so while a save is held they would otherwise work from an outdated copy. In Delayed Autosave mode such a rewrite first flushes that note's pending changes, so it reads what you actually have on screen — one write earlier than the delay alone would have made. In Autosave Disabled mode nothing is ever written on your behalf: Obsidian merges the change into your editor instead and your note stays unsaved until you save it.

Testing

  • Run npm install.

Desktop:

npm run wdio:desktop

Android:

npm run wdio:android

All tests:

npm run wdio

One test:

npx wdio run ./wdio.conf.mts --spec ./test/specs/autosave-control.e2e.ts --mochaOpts.grep "stops typing and waits for exactly one save after the configured delay"

License

MIT — see LICENSE