Mini Plugin: Update Internal Links When Renaming Headings

GitHub: obsidian-keep-headings
Original Post: Obsidian Chinese Forum t38592

Test in v1.6.7 Sandbox Vault:

240813

  • Trigger when clicking on a heading or heading line. Auto submit when clicking outside. Press Esc to cancel.
  • Won’t trigger on right click or click with altKey. For management.
  • Data processing fully relies on official “Rename this heading” command. Safe.
  • Avoid interrupting the editing experience. Convenient.

240831

  • When you press Enter in the middle of a heading, the content before the cursor will be submitted as a new heading, and the rest will move to the next line.

  • The background color is not set by default. If you want a background color similar as the GIF shows, you can add the following CSS:

    .kh-bg {
      background: var(--background-modifier-cover);
    }
    

241017

The built-in editing popover of the v1.7.4 Core Plugin Page Preview has not been well integrated with other functions of the software itself. Issues such as the right-click menu closing the popover automatically are not caused by this plugin. You can retain those functions along with other plugins or your own preview editing view. As an example you can refer to Editable Popover and Exportable Markdown Mindmap

5 Likes

I haven’t tested this yet, but have been waiting for something like this for the longest time! Thanks so much!

I look forward to seeing this in Community Plugins!

Are you aware of GitHub - dvcrn/obsidian-filename-heading-sync: Obisdian.md plugin to keep the filename and the first header of the file in sync, which provides roughly the same functionality?
I’ve been using it for years; works fine for me.

@FilSalustri Thanks. I took a screenshot of the “Features” section from the obsidian-filename-heading-sync plugin’s README.md on 2024-08-16. It appears that the plugin does not mention the feature to automatically update internal links, such as [[MD#Test]] , when renaming a heading ‘Test’ within the note ‘MD.md’." Did it provide similar functionality?

Ah, I missed that part of your plugin - sorry.
As far as I know, filename-heading-sync does NOT handle internal links, so that’s definitely a distinguishing feature of your work.

How do you install this? Do I need something like a javascript plugin to run this?

edit: got it. in case anyone else is wondering - after I saw the manifest on github I realized I could probably add it through BRAT - and it worked.

@teme Did you see the Readme I wrote on the GitHub? That’s for developers, because most of the plugins are written in TS. They might think this is compiled code when they see me putting a JS file there. In fact, this is the source code and can be edited directly. That’s what I meant.

As for installing this plugin, whether you download and install it from the releases or use another method is ok.