Skip to main content

Sticky scroll in vscode

ยท One min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Sticky scroll in vscode

https://dev.to/amrsamy/vs-code-sticky-scroll-2jcd

vscode has recently added a really useful new feature: sticky scroll.

This function allows you to scroll through a document such as a Markdown file, a source code written in PHP or JavaScript or any other supported language and, as you scroll, block contextual information such as the name of the class, the name of the function, the start of the loop, etc. in the upper part of the editor.

This is really very practical; see the illustration below (image coming from https://dev.to/amrsamy/vs-code-sticky-scroll-2jcd)

Sticky scroll in vscode

Below an example taken from this blog:

Sticky scroll in markdown

As you can see, I've opened a markdown file and I'm showing part of the article around line 878. Pay attention on the first 'sticked' lines in the window: vscode is showing me my heading 1, my heading 2 and my heading 3 so I know the context. The displayed lines are located in chapter Make it easy. That's pretty cool!

To enable the feature, edit your settings.json file and add this entry:

"editor.stickyScroll.enabled": true