obsidian-hotkeys-for-templates icon indicating copy to clipboard operation
obsidian-hotkeys-for-templates copied to clipboard

(little) Conflict with "Filename Heading Sync"

Open Oskiator opened this issue 3 years ago • 5 comments

Hi !

I've just tried your plugin and love it ! I've met a little conflict with the "Filename Heading Sync" plugin which sync the file name with the H1 of the note.

So when I create a new note with the sync of the title and the automatic addition of the template : The following actions are done :

  1. I create the new note
  2. Filesync sync the filename with the title and so add to the top of the note "# title" image
  3. Hotkey for template add automatically a template to the note at the beginning of the file so before the "#title" image
  4. Filesync sync again the title image

Consequence : the title appears both at the beginning and at the end of a note, instead of just being on the top.

Solution : Add a way to consider the H1 title created by "Filename Heading Sync" and add the template below. Solution 2 : Delay the action of "Filename Heading Sync" , so that the template is first loaded and then the title synced.

Would it be possible to implement one of those solutions ? I can also open an issue on the side of the Filename Heading Sync plugin.

Many thanks for your work !

Michaël

Oskiator avatar Feb 06 '22 18:02 Oskiator

First, thanks for the great documentation of the problem. You are using normal Obsidian templates right? Not the templater plugin ones. Will investigate.

Vinzent03 avatar Feb 07 '22 16:02 Vinzent03

Thanks for your fast answer and your work Vinzent. I'm effectively using the normal obsidian templates.

Oskiator avatar Feb 07 '22 18:02 Oskiator

Hmm I can't reproduce. My template is inserted after the heading, so it doesn't duplicate.

Vinzent03 avatar Feb 07 '22 20:02 Vinzent03

Thanks. Following your answer, I've done some test with a new vault and I didn't have the problem I've mentionned to you. Then I played with obsidian config files, adding files of my usual vault to the new one. And then deleting/readding parameters to isolate the "problematic" one. I finally found it. It's option "legacyEditor". When legacyEditor is disabled, the template is inserted before the synced title.

Oskiator avatar Feb 07 '22 21:02 Oskiator

I'm back and I see another little problem always related to the "Filename Heading Sync" plugin.

Context :

  1. Several notes are open
  2. Filename Heading Sync is activated
  3. I creating a new note in a folder set up with automatic template with Hotkey for template

What happen ? The content of the template appears briefly and is immediately replaced by the title of the file, When doing Ctrl + Z, the title disappear and is replaced by the template.

Here is a demo : https://sharing.clickup.com/clip/p/t2488852/7e587c9a-bdd0-4833-abe9-5de27e3072ec/screen-recording-2022-02-08-14%3A50.webm

It seems that both plugin compete.

Have a nice day ;)

Oskiator avatar Feb 08 '22 13:02 Oskiator