Get "PHP 8 in a Nuthshell" (Now comes with PHP 8.3)
Amit Merchant

Amit Merchant

A blog on PHP, JavaScript, and more

Sticky scrolling in VS Code

Love it or hate it but VS Code by Microsoft is one of the most widely used text editors today and that’s because of its versatility and features that are helpful.

So, in a recent version, the editor comes packed with an experimental feature that can make writing/reading code a joyful experience.

The feature is essentially a sticky scrolling that lets you know in which scope (class/interface/namespace and function/method/constructor) you’re currently scrolling.

You can enable this feature by setting "editor.experimental.stickyScroll.enabled" to true in your VS Code’s settings.json or search for “sticky scroll” in the Setting’s search and tick the checkbox for the appeared setting.

Here’s what scrolling through the code looks like when the feature is enabled.

Sticky scrolling in VS Code

As you can tell, when you scroll, the current function/method/class definition gets “stuck” to the top which effectively lets you know in which scope you’re currently in. And this, in my opinion, is a game changer and can drastically improve the way you read/write your code!

Like this article? Consider leaving a

Tip

👋 Hi there! I'm Amit. I write articles about all things web development. You can become a sponsor on my blog to help me continue my writing journey and get your brand in front of thousands of eyes.

Comments?