Always run "Rename this heading" command when a heading is clicked

If there was a plugin which could always trigger the Rename this heading command upon clicking/focusing a header then that would reduce the chance of ever editing a header directly and thereby breaking links in the vault to it.

There is a feature request to improve upon how Obsidian works to make renames of headings update links automatically without this pop-up, but in the interim, this plugin could serve as a basic fix to an over two years old problem.

It could be as simple as: If the cursor changes to a line beginning with 0+ whitepace, followed by 1-6 # characters, run Rename this heading. There’d likely be some undesirable UX side effects, but probably not major ones, ones I’d consider worth the trouble to deal with to help ensure links to headings don’t break.

However, I’m not sure if it’s even possible to trigger this command as there’s a topic named API to access the “Rename heading” functionality?.

Thanks!

7 Likes

In the same opening, and move this file to option would be great.

I’d add “followed by whitespace” but also there may be some other way to target, like using HTML class(es).

2 Likes