DEV Community

Rach Smith
Rach Smith

Posted on • Originally published at rachsmith.com on

Keyboard shortcuts for navigating a large file in VSCode

When writing the code gets a bit dull at my job, I try to make things more interesting by setting myself a challenge in other ways. Currently, I am training myself to use the keyboard to get around VSCode instead of a mouse. I'll list a few of my favourites (on macOS).

Fold all: command+k command+0

This folds all the foldable sections of a file. I find it makes files easier to scan at a high level.

Go to Symbol: shift+command+O

This allows you to search for and jump to any symbol on the page. Great for getting to the start of a method or function.

Go to line: control+G

Enter the line number, and there you go. Great for when you're dealing with stack traces. I use it more to jump around a file quickly without needing to scroll.

control+option (with Space Block Jumper extension): Jump to next empty line

I use the Space Block Jumper extension to do this one. It takes you to the next blank line in the file. It allows you to move through a file faster than you would by scrolling with the up/down keys.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay