obsidian-linter icon indicating copy to clipboard operation
obsidian-linter copied to clipboard

FR: Keep first H1 heading in sync with filename

Open Ampa opened this issue 3 years ago • 3 comments

I use the option to insert an H1 heading with the filename. But if I later change the filename the H1 heading no longer reflects the filename.

Could you add an option to keep the two in sync?

Possible complications...

  • Should the sync be 2 way? If I change H1 should the filename change?

Existing solutions...

  • There is an existing plugin which offers this function, but it would make sense to include keep all linting type operations in a single plugin.

Thanks for your consideration.

Ampa avatar Apr 26 '22 10:04 Ampa

Im curious how that plugin handles the complications, if it makes sense that function can be added here.

platers avatar Apr 26 '22 20:04 platers

how that plugin handles the complications

From the plugin's README:

  • When renaming the current file -> will update the heading
  • When opening a file that doesn't have a heading yet -> will insert one
  • When opening a file with a different heading than the current file name -> will update the heading
  • When updating the heading of a file -> will rename the file

yimingli avatar May 20 '22 22:05 yimingli