Dryden Bryson4 downloadsAutomatically tag notes based on the folder they live in.
Tag notes automatically based on the folder they live in.
Features · Install · Usage · Settings · Limitations · Contributing
🏷️ Hands-off tagging
|
🔄 Stays in sync
|
Whenever tags would be removed, the plugin asks first. Tick Don't ask again to make your answer the default, and change it any time in settings.
[!IMPORTANT] Requires Obsidian 1.13 or later.
main.js, manifest.json and styles.css from the latest release, or build them yourself.<Vault>/.obsidian/plugins/tagging-folder/.Dryd33n/obsidian-tagging-folder.project or area/work. A leading # is fine.From then on, notes created in or moved into the folder get the tag in their tags property.
[!TIP] Right-click the folder again to edit its tag, re-apply it to every note in the folder, or disable auto-tagging.
| You move a note… | What happens |
|---|---|
| Into an auto-tag folder | The folder's tag is added |
| Between two auto-tag folders | The new folder's tag is added and the old one is removed (or kept, see Settings) |
| Out to a normal folder | The tag is removed or kept, see Settings |
| Within the same auto-tag folder | Nothing changes |
Moving a folder of notes gives a single prompt for all of them. Closing a prompt without choosing always keeps the tags.
Under Settings → Tagging Folder you'll find every auto-tag folder, each with an ⚙ Edit button and a Delete button that disables auto-tagging for that folder, and two behaviour settings. All of them show up in Obsidian's settings search.
| Setting | Options | Default |
|---|---|---|
| When disabling a folder's auto-tagging | Ask every time · Remove tags · Keep tags | Ask every time |
| When a note leaves an auto-tag folder | Ask every time · Remove tag · Keep tag | Ask every time |
Per folder:
| Option | Default |
|---|---|
| Tag name | — |
| Include subfolders | ✅ On |
| Tag existing notes (when enabling) | ✅ On |
[!NOTE] Turning Include subfolders off counts as the subfolder notes leaving the folder, so it follows the "leaves an auto-tag folder" setting.
#project before its folder was auto-tagged, disabling the folder or moving the note out can remove it.[!NOTE] Privacy: everything runs locally. The plugin only edits the
tagsproperty of notes in your auto-tag folders.
Issues and pull requests are welcome.
git clone https://github.com/Dryd33n/obsidian-tagging-folder.git
cd obsidian-tagging-folder
npm install
npm run dev # rebuild main.js on change
Copy main.js, manifest.json and styles.css into a test vault at .obsidian/plugins/tagging-folder/, then reload Obsidian.
npm run lint # Obsidian's plugin lint rules
npm test # unit tests for the tagging logic
npm run test:e2e # end-to-end tests in a real Obsidian instance
The end-to-end suite builds a fresh test-vault/, launches an isolated Obsidian instance with its own data folder (your normal Obsidian and vaults are untouched), runs every flow through the real UI and checks the notes on disk. It uses the newest Obsidian version your install has downloaded; set OBSIDIAN_ASAR= (empty) to test the older version bundled with the installer instead.
| Variable | Effect |
|---|---|
OBSIDIAN_PATH |
Obsidian executable, if it isn't at %LOCALAPPDATA%\Obsidian\Obsidian.exe |
OBSIDIAN_ASAR |
Test a specific Obsidian app version (obsidian-x.y.z.asar) |
KEEP_OPEN=1 |
Leave the test instance running afterwards to explore the test vault |
E2E_DEBUG=1 |
Log the active window before each test and list open modals on failure |
master and keep each PR focused on one change.npm run lint, npm run build, npm test and npm run test:e2e pass.main.js or other build output committed.Bump version in manifest.json and package.json, add the version to versions.json, then push a tag with the same version (no v prefix). CI builds the plugin, attests the release files and creates a draft release for you to publish.
| Path | Contents |
|---|---|
src/main.ts |
Plugin lifecycle, vault events and rule actions |
src/rules.ts |
Folder scope and tag logic (no Obsidian dependency) |
src/modals.ts |
Folder modal and confirmation prompts |
src/settings.ts |
Settings tab |
tests/ |
Unit and end-to-end tests |
PLAN.md |
Behaviour spec |