Keyboard-based navigation for ToC and backlinks

One of my most missed features in Bear 1 was heading navigation, and I’m glad there is now a “Table of contents” pane in Bear 2.

That said, it is currently impossible to quickly navigate to a heading using only the keyboard like it would be possible in Sublime Text, VSCode, and other software.
There is a keyboard shortcut to make the Table of contents appear, but then the functionality is very limited and only available using the mouse. Here’s what’s missing:

  • knowing where you’re at (having the current heading visible and selected in the ToC)
  • going to the previous/next heading using the arrow keys
  • searching for a heading by typing a few characters and navigating the search results
  • going to the selected heading and closing the pane, using the Return key
  • canceling the heading navigation and putting the cursor/selection like it was prior to invoking the ToC, using the Escape key

With these things, I’m able to zip through my note at lightning speed. Without them, I feel like a slog.
For an example of how it works in another app, here’s FoldingText with the “Go to heading” plugin (which is pretty close to ideal to me, except the scrolling is sometimes a bit off):

While such an interface would likely require some work, it could be used not only for the ToC, but also for navigating the backlinks and the note list.
This design is an “omnibar” like found, e.g., in Obsidian, but you don’t need to strictly follow that to get the benefits: supporting keyboard interaction in the ToC and backlink panes would be enough (as well as highlighting the current heading). The “live preview” (seeing the note scrolled at the right place before confirming) is nice and helpful, but it’s not the most important bit.

2 Likes

Well said and it’s a shame Bear Team didn’t response at least a couple of words about it.
Stumbled with this use case arriving from Obsidian and accustomed to use Quick Switcher plugin to navigate through headers using keyboard only. Very practical with large notes.