Float active header in the gutter or on top of screen while scrolling (sticky scrolling for headings)

Use case or problem

When notes become long, eventually you will scroll past the headers of sections containing large amounts of text. Perpetually seeing the header of the active section can be a useful visual cue for writing and also looks quite nice.

Proposed solution

Float the active header in the gutter while scrolling until a new header is encountered, which then replaces the previous one in the gutter. For aesthetic reasons, I prefer the gutter/margin, but if this is not possible then "[sticky scroll](https://learn.microsoft.com/en-us/visualstudio/ide/editor-sticky-scroll?view=vs-2022)" as shared by @obsequious where the content is "stuck" to the top of the screen would also work.

For example, let’s say I’m working on content that is under Heading 1. I would like Heading 1 to stay at the top of the screen or in the left gutter until I create or reach Heading 2, at which point Heading 2 would replace Heading 1’s position on the screen while scrolling.

Current workaround (optional)

Looking at the Outline view in the sidebar.

New plugin

A new plugin by @imshenshen has just gone live which achieves this functionality. It’s a really good solution and is exactly what I had in mind! Thank you However, the visual is changed a little and it only works in Live Preview.

With plugin
ezgif-5-fa6c2a7821

Normal

edited on 2024-01-25 to include specific example and correct terminology
edited on 2024-03-23 to include new plug-in

3 Likes

Don’t you want something more like Sticky Scroll common in IDEs About the Editor Sticky Scroll feature - Visual Studio (Windows) | Microsoft Learn ?

3 Likes

This is what I’d like! I just didn’t have the words to describe it. I’ll modify the title of the post to include this terminology and add your link to my post.

But yes, this would be ideal if it could be implemented for headings. Let’s say I’m working on content that is under Heading 1. I would like Heading 1 to stay at the top of the screen or in the left gutter until I create or reach Heading 2, at which point Heading 2 would replace Heading 1’s position on the screen while scrolling.

+1 Is there a quick and dirty solution to this? Because I can’t find a plugin as of now.

Unfortunately I am totally incapable of developing a solution and must rely on the hard work of others.

A current core feature that is helpful is that the heading under which your cursor is placed will be highlighted in the Outline pane.

Please Make this available Devs!