-
Notifications
You must be signed in to change notification settings - Fork 112
Description
Is Your Feature Request Related to a Problem? Please Describe.
Yes. Many users, especially those using Zettelkasten or timestamp-based notes, use a prefix in their filenames (e.g., YYYYMMDDhhmm_). The problem is that Linter's current title-related rules apply to the entire filename. This means if I want to sync my filename with my H1 or frontmatter title, the ugly prefix (e.g., 202510291209_) gets synced as well. I'm always frustrated that I cannot have a clean H1/frontmatter title that stays in sync with the semantic part of my filename.
Describe the Solution You'd Like
I would like a new rule (or an enhancement to the existing "YAML Title" rule) that enables 3-way synchronization between the H1 heading, the title key in the frontmatter, and the filename, while ignoring a specified regex prefix in the filename.
This rule would need a new setting: "Regex prefix to ignore in filename".
The sync should be multi-directional:
- If I change the filename: The plugin should strip the prefix, and update the H1 and frontmatter
titlewith the rest of the name. - If I change the H1: The plugin should update the frontmatter
titleand the filename. When updating the filename, it must preserve the original prefix. - If I change the frontmatter
title: The plugin should update the H1 and the filename. When updating the filename, it must preserve the original prefix.
Please include an example where applicable:
My Regex Setting: ^\d{12}_
Scenario: User changes the H1 Heading
(File is currently named 202510291209_My Old Note.md)
---
title: My Old Note
---
# My New Note
This is my note.Expected Linter outcome:
- Linter detects the H1 change.
- It updates the frontmatter
titleto "My New Note". - It updates the filename, preserving the prefix, to
202510291209_My New Note.md.
Result:
---
title: My New Note
---
# My New Note
This is my note.(And the file is renamed)
Describe Alternatives You've Considered
I have considered the File Title Updater plugin, but it does not support ignoring prefixes; it syncs the entire filename. I have also tried the existing Linter rules (like "YAML Title" with the "Filename" mode), but they are one-way (Filename -> Title) and do not handle the multi-directional sync I need (e.g., H1 -> Filename).
Additional Context
This feature would be incredibly valuable for anyone using a Zettelkasten (timestamp-based) naming convention. It bridges the gap between having a machine-readable, unique filename (for sorting and ID) and a human-readable, clean title (for reading and linking).