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

Yeah the logic definitely needs some revamping to make it less destructive. Maybe some toggles in the settings, or commands you have to manually run to “start syncing”.

When you open a file, it doesn’t rewrite the filename, just the heading of that file. Only if you were to update that heading it would rename the file, but even for me it messed up some headings that I created before using this plugin :innocent:

I want to add some kind of tag to the file to mark it as “this is enabled for syncing” but don’t want to insert random stuff into documents

2 Likes

could we have a setting to exclude a Templates folder?

3 Likes

If you have any good ideas how to handle exclusions (or inclusions) in a nice way, let me know and I’ll try to get it in.

Having a “excluded folder” setting doesn’t scale nicely and doesn’t fix the underlaying problem on what should happen when.

Maybe an “exclude this file” command? And save that into the state of this plugin. Although that could get big over a longer period of time.

I asked about the availability of the plug-in in the Discord channel. Excellent work, btw.

Some people like myself prefer lower case filenames. A setting to lower case the filename perhaps?

1 Like

Thanks, this looks useful

This plugin is currently not updating backlinks yet. That’s a bug in obsidian is and being worked on according to some folks on the discord.

I also created Vault.rename(file, path) is not updating existing links

The plugin should insert the heading after the YAML frontmatter, if present.

5 Likes

Released 1.1.0 with support for ignoring certain files through a new “ignore this file” command

Also fixed the issue that links aren’t updated when renaming through this plugin

1 Like

It’s failing to install for me.

I had it installed previously, then it said there was an update. Tried to update, failed. Removed the plugin and attempted to install, but now it fails installation. So it seems something is wrong with the most recent release.

Are you on the required version (0.11.0)? I just tried to reinstall it on a different machine (both update from 1.0 and remove → install) and had no issues here
Screen Shot 2021-02-23 at 11.15.14

1 Like

I thought automatic updates kept it updated, but turns out I needed to relaunch.

I now have it reinstalled. Thank you!

Can we just use some internal reference to file name?
Some something like:

## {file_name}

  • so it will just refers to file name
  • when the filename is changed the header is change.

With this we don’t need plugin.

8 Likes

Could this update the title in yaml frontmatter as well? That would be even more useful to me :slight_smile:

3 Likes

I don’t use frontmatter. How does this look like, can you post an example?
Is this normalized and common, or more something specific to your setup?

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