Plugin for keeping the filename and first heading of a file in sync

Syncing a Title: field in the YAML frontmatter works for me as well.

I currently have the following YAML frontmatter in a common template:

---
Title:	202103141624
Summary:	
Tags:	
Note Type:	#NoteType/TBD
Created:	2021-03-14 16:24

---

So having an option to sync the first H1 heading (within the first # lines), or sync the specified YAML tag (e.g.: “Title:”) would give lots of flexibility.

Mike

3 Likes

Thanks for supplying the requested information, I had put this a bit far back in my mind… Hope it can be helpful in adding this functionality.

I don’t see a way to designate the files to be ignored - is that in a settings file in the plugin directory? Within the file itself? Any help would be appreciated. I tried adding info to the data.json file in the obsidian-filename-heading-sync plugin directory, but either that isn’t where it goes or I’m not formatting the data correctly.

Also, I don’t see anything in the UI beneath the “Ignored files” header. It is totally blank in the bottom of the dialog.

@sararkin Great plugin! How can I deactivate the automatism for the contents of my templates folder?

Sorry if that’s unclear. I’ll add some explanation to that settings page

This plugin packs an action that you can call through the action palette on any file, so if you have a file currently open you want to ignore, open the palette and select ignore this file. It’ll add it to that settings pane

Great plug-in, thanks a lot! However, for the current state of my vault, it’s the wrong way around. Is there a way to set it up so that it renames files (according to the header)?

1 Like

On popular request, it is now possible to set regex ignore patterns

This can be used to, for example:

  • Ignore everything under a specific folder: templates/
  • Everything that has tmp in the name: tmp
  • Everything that has a series of numbers followed by a dash (like 123456 - Hello.md): [0-9]+\ \-\
6 Likes

Is there any chance an option could be added to make this work in one direction? Maybe a three-option selector:

  • Filename <-> Heading
  • Filename → Heading
  • Heading → Filename

My own use case is strictly that last one, where I always adjust the filename to match whatever I’ve changed the heading to, and not the other way around.

To go with this, it would be useful to have an way to set what illegal characters get replaced with in a filename - by default an empty string (“Test: Thing” becomes “Test Thing”), but some might wish to set it to “-” or other placeholders (“Test: Thing” becomes “Test- Thing”).

4 Likes

Useful plugin for me! Save me much time. Thanks a lot!
Is it possible to skip YAML attributes block and start searching 1-st header after the attributes block? Otherwise, it breaks the attributes.

Any progress on this?

This. I have a bunch of ill-named .md files that I’d like to fix from their contents i.e. from the title inside the file.

Hello. I’ve found a bug that was caused by your plugin.

Description

Double open the same note via a link from a note which has been added in the sidebar, delete all content inside this note.

Steps to reproduce

  1. Add a note to the sidebar
  2. Add a link to another note inside this note
  3. Click the link and then click to open the second tab with this note
  4. All content is deleting in a note that the link refers to

Screen capture: iCloud

Expected result

Content isn’t deleting when double-clicking on a link in a sidebar note.

Environment

  • Operating system: MacOS 12.0 beta
  • Obsidian version: 0.12.10
1 Like

Hi! I’m the author of that plugin but wasn’t able to reproduce your issues no matter what I tried. I still added a few changes to harden the plugin.

Do you have some steps to reproduce? Can you post a list with all plugins you have installed? It feels to me it might be an interaction between 2 things

Github thread: Data-loss · Issue #18 · dvcrn/obsidian-filename-heading-sync · GitHub

BTW I have also added support for YAML frontmatter skipping and squashed a few other smaller bugs in the same step.

New update will be out in a bit

5 Likes

I’ve had the same issue. My active plugins are:

  • Sliding Panes (Andy’s Mode)
  • Tag wrangler
  • Shortcuts extender
  • Style Settings
  • Hider

thanks, your plugin is precious!!

1 Like

Do you have some steps to reproduce this?

I’ve pushed v1.4.0 with some bug fixes and frontmatter support. Please update if this issue pops up again

This is most helpful! Thanks. And thanks for the update to allow excluding files. That really made it possible for me to safely install this! :grinning:

1 Like

When I add a link in a note, then I “cmd click” on this link, it creates a file with the link as filename but then the plugin doesn’t create the title . Normal?

1.5.0 has been released today which should address this. Can you give it a try?