# Headings chooser possible as a plugin?

**URL:** <https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291>\
**Category:** Plug Development\
**Created:** [November 22, 2024, 11:39am UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291 "2024-11-22T11:39:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tagirijus](https://community.silverbullet.md/user_avatar/community.silverbullet.md/tagirijus/32/1515_2.png) [@tagirijus](https://community.silverbullet.md/u/tagirijus)\
**Post date:** [November 22, 2024, 11:39am UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291/1 "2024-11-22T11:39:03Z")

</div>

Hey there,

I was thinking about digging into the plugin development or so, since I am missing a feature, I have in Sublime Text:

![2024-11-22_12-36-27_head_chooser](https://community.silverbullet.md/uploads/default/original/1X/171920015cf0917d30c716b10e7dda2319b05f98.gif)

What you can see is: there are certain headings, even with different depths. Now I press a shortcut, which will bring up the panel picker, which lists all headings in the document. If I choose one, the cursor will jump to this heading, thus also scroll to it.

Would such a thing technically be possible in Silverbullet?

---

<div class="post-metadata">

**Author:** ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)\
**Post date:** [November 22, 2024, 5:35pm UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291/2 "2024-11-22T17:35:06Z")

</div>

Yes it should be. Some pointers:

This is where the table of contents widget is implemented, which also shows how the header scan can be implemented: [silverbullet/plugs/index/toc.ts at main · silverbulletmd/silverbullet · GitHub](https://github.com/silverbulletmd/silverbullet/blob/main/plugs/index/toc.ts)

Then, you can use the editor.filterBox syscall: [editor.filterBox from syscalls - @silverbulletmd/silverbullet - JSR](https://jsr.io/@silverbulletmd/silverbullet@0.10.1/doc/syscalls/~/editor.filterBox) to make a pop-up box appear (similar in style as the page and command picker).

---

<div class="post-metadata">

**Author:** ![bent0n](https://community.silverbullet.md/user_avatar/community.silverbullet.md/bent0n/32/604_2.png) [@bent0n](https://community.silverbullet.md/u/bent0n)\
**Post date:** [November 22, 2024, 7:48pm UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291/3 "2024-11-22T19:48:24Z")

</div>

I think I could do a basic filterbox.

But I’m wondering if it would be possible to have different action based on key presses?

My thoughts are:

Enter: moves cursor to heading  
space: show/hide sub level of selected heading  
Shift-space: show/hide all sub levels

---

<div class="post-metadata">

**Author:** ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)\
**Post date:** [November 22, 2024, 7:57pm UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291/4 "2024-11-22T19:57:45Z")

</div>

The filter box API doesn’t currently support this

---

<div class="post-metadata">

**Author:** ![bent0n](https://community.silverbullet.md/user_avatar/community.silverbullet.md/bent0n/32/604_2.png) [@bent0n](https://community.silverbullet.md/u/bent0n)\
**Post date:** [November 22, 2024, 8:01pm UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291/5 "2024-11-22T20:01:28Z")

</div>

That’s what I thought. I’ll go the easy route then.

One filter box with main heading and a different one with all levels.

---

<div class="post-metadata">

**Author:** ![tagirijus](https://community.silverbullet.md/user_avatar/community.silverbullet.md/tagirijus/32/1515_2.png) [@tagirijus](https://community.silverbullet.md/u/tagirijus)\
**Post date:** [November 24, 2024, 7:27pm UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291/6 "2024-11-24T19:27:03Z")

</div>

Hey there, sorry for the late reply. Thanks so much for the inputs and the direct source code links! Good to know that it might be possible. And cool to have ideas already on how to do this. I will see what I can do with these information and will share anything I come up with here, of course. (=

---

<div class="post-metadata">

**Author:** ![zeus-web](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zeus-web/32/571_2.png) [@zeus-web](https://community.silverbullet.md/u/zeus-web)\
**Post date:** [January 23, 2025, 8:37pm UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291/7 "2025-01-23T20:37:09Z")

</div>

Just for reference, as I recently found this plugin:

> **[GitHub - minusInfinite/outline-sidebar: An Outline Sidebar for silverbullet.md](https://github.com/minusInfinite/outline-sidebar)**
>
> An Outline Sidebar for silverbullet.md

Not exactly what you are looking for, but might be helpful, too.

---

<div class="post-metadata">

**Author:** ![tagirijus](https://community.silverbullet.md/user_avatar/community.silverbullet.md/tagirijus/32/1515_2.png) [@tagirijus](https://community.silverbullet.md/u/tagirijus)\
**Post date:** [January 24, 2025, 6:50am UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291/8 "2025-01-24T06:50:13Z")

</div>

Hey there, thanks for the hint. It might not be the thing I am exactly looking for, but it might help me to understand how to code such a thing I am looking for myself! So thanks a lot. (=

---

<div class="post-metadata">

**Author:** ![tagirijus](https://community.silverbullet.md/user_avatar/community.silverbullet.md/tagirijus/32/1515_2.png) [@tagirijus](https://community.silverbullet.md/u/tagirijus)\
**Post date:** [February 5, 2025, 2:30pm UTC](https://community.silverbullet.md/t/headings-chooser-possible-as-a-plugin/1291/9 "2025-02-05T14:30:53Z")

</div>

I finally made it! I shared the plugin here: [Headings Picker](https://community.silverbullet.md/t/headings-picker/1745)

Thanks for all your help!
