Lars Bücker159 downloadsKeep attachment locations consistent when notes are moved.
Consistent Attachments keeps your vault tidy by moving (or copying) note attachments when notes move between folders.
In many vaults, attachments drift away from their notes over time:
This plugin automates the common cases while preserving control for edge cases.
skip, copy, or ask.-1, -2, ...).main.js, manifest.json, styles.css.<Vault>/.obsidian/plugins/consistent-attachments/skip: keep shared files in placecopy: keep original, create note-local copyask: prompt for every shared fileFollow Obsidian defaultSubfolder of note (configure subfolder name)Same folder as noteFixed vault folder (configure fixed path)Move attachments for current noteApply attachment layout to vault — scan all notes and move attachments to match the current target path settingsFind orphaned attachments — unreferenced files only; safe to deleteFind misplaced attachments — linked files not at the expected path; relocate instead of deleteShow recent operation logToggle auto-move on/offAdditionally, the file explorer context menu for markdown notes contains:
Move attachments for this noteWhen another note also references the same attachment, the plugin applies your configured strategy:
The plugin never overwrites existing files. If a destination filename already exists, it appends a numeric suffix:
image.pngimage-1.pngimage-2.pngvault.getMarkdownFiles() and read note content with vault.cachedRead() to resolve linked attachments.vault.getFiles(), maps referencers from metadataCache.resolvedLinks and markdown notes, then lists unreferenced attachment candidates.Requirements:
Commands:
npm install
npm run build
npm run lint
npm run dev