DEV Community

Cover image for Keyboard shortcut to get out of node_modules folder in Visual Studio Code
Sung M. Kim
Sung M. Kim

Posted on • Originally published at slightedgecoder.com on

Keyboard shortcut to get out of node_modules folder in Visual Studio Code

🌧️ Introduction

Visual Studio Code has been de facto choice of front-end development.
What do you usually use for front-end development? NPM packages.

πŸ€” Problem

As you are navigating JavaScript code, you are bound to stumble upon a code in node_modules folder.

And It’s a pain 😠 to scroll all the way up and close it.

So how do you quickly close node_modules folder?

πŸ“œ TL;DR

Press and hold down the ⬅️ left arrow key.

Yeah, seriously that’s it.
It works in Windows Explorer and Atom, as well.

Here is the live action.

This will save you at most 5~10 seconds but it will add up.
I've been stuck in node_modules folder hell so many times and decided to share this tip.

The post Keyboard shortcut to get out of node_modules folder in Visual Studio Code appeared first on Slight Edge Coder.

Top comments (14)

Collapse
 
rhymes profile image
rhymes • Edited

My way of dealing with node_modules is to tell Visual Studio Code to totally ignore it in the Explorer: stackoverflow.com/a/33277809/4186181

Collapse
 
dance2die profile image
Sung M. Kim

Thanks @rhymes .
VS Code is like onion. The more you know, there is more to know :p

Collapse
 
rhymes profile image
rhymes

ahhahah

Collapse
 
nbouliol profile image
nbouliol

Thank you !

Collapse
 
clairecodes profile image
Claire Parker-Jones

I've just discovered this also works in Atom too!! πŸŽ‰ Thanks for sharing!

Collapse
 
dance2die profile image
Sung M. Kim • Edited

Oh sweet.
Thank you for checking out Atom @Claire.
Updated the post to include Atom in the list :)

Collapse
 
josegonz321 profile image
Jose Gonzalez

Sweet trick!

Have you consider submitting to vscodecandothat.com/?

I am sure Burke Holland and Sarah Drasner would like this one!

Collapse
 
dance2die profile image
Sung M. Kim

Thank you Jose,

That page is amazing.
I will look how to submit to the site :)

Collapse
 
9gtm profile image
4:5GTM

Ah! That was trick question right?
Cuz' node_modules is a black-hole.
Hence you can't get out!.
Yasss I got it!!

Collapse
 
ryanyizhaohuang profile image
Ryan Huang

This solves my pain, thank you.

Collapse
 
dance2die profile image
Sung M. Kim

Glad to be of help πŸ˜ƒ

Collapse
 
iamfrntdv profile image
Eduard Pochtar πŸ‘¨β€πŸ’»

In webstorm you just press left arrow key and it will jump to parent folder. Sometimes you may need to press it few times but that’s quick enough.

Collapse
 
dance2die profile image
Sung M. Kim

Thankd Eduard.

It seems like left arrow key works in many editors.
It works in Visual Studio (not code) and SQL Server Management Studio as well :)

Collapse
 
ofhouse profile image
Felix Haus

Changed my life. 😜
So simple that I don't know why I was not able to find it out by myself.
Thanks from my lazy brain for sharing this πŸ‘