Heading: Global Search filter option

Use case or problem

I often want to find a specific heading that exists somewhere in my vault. I can use [[## but unfortunately it doesn’t have the benefits of Global Search such as Page Preview, etc.

Proposed solution

Add a heading: filter to Global Search to search only the text within the heading names.

Related feature requests

Relevant request: Page Preview on [[## and Quick Switcher suggestions

Thanks!

1 Like

You can get part of the way there using line:().

e.g. line:(mango), but that will pull in things that may not be headings. If you know the heading level beforehand, you can get closer. line:(## mango)

1 Like

Searching # example will find a heading of any level named or starting with “example”. In principle it will also match non-heading text but is unlikely to actually do so. But you can prevent that by searching [^# example]. To find “example” anywhere in a heading, I believe [^# (.*)example] should work.

2 Likes