Code better with these VS Code tips

Muhammad Yusuf
3 min readDec 22, 2020

--

Photo by Christin Hume on Unsplash

VS Code has decent documentation, but not everyone has the time to explore what it has to offer. With this article, I hope you get something new to code even better in VS Code. So here’s the list.

Intellisense

VS Code IntelliSense features are powered by a language service. If a language service knows possible completions, the IntelliSense suggestions will pop up as you type. If you continue typing characters, the list of members (variables, methods, etc.) is filtered to only include members containing your typed characters. Pressing Tab or Enter will insert the selected member.

Custom Region

You can collapse every block of code you’re writing by default, as long as they’re enclosed by parentheses. But you can also make your own block to collapse by adding the following:

// #region
// #endregion

Balance Inward/Outward

You can select a whole tag in VS Code by using the balance inward and balance outward Emmet commands. They have no keybindings but it's helpful to bind these commands to keyboard shortcuts, like in example below, Ctrl + Option + Up Arrow for Balance Outward and Ctrl + Option + Down Arrow for Balance Inward.

File Connectivity

Similar to intellisense, when you type a variable, you can see wether it is a valid (defined) variable or not. If it is, you can hover on it to see information of its source (data type, value, or in function, parameters and return value). If it’s not, it’ll just show any.

Moreover, if you define the variable from another file, you can jump directly to its definition by using ctrl/cmd + click .

Pasting a URL to your markdown

This one is very useful, especially if you keep forgetting which comes first, the round bracket or the square one? Simply select the text you want and paste the URL you copied.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Muhammad Yusuf
Muhammad Yusuf

No responses yet

Write a response