DEV Community

Simc Dev
Simc Dev

Posted on

7 Best Visual Studio Code Tricks

As a developer, he would like to code with VS Code editor. It's one of the most popular code editors. It has lots of advanced features and plugins that you can customize your VS Code. VS Code has the best themes to make your VS Code more beautiful for coding. As a senior developer, he must have to know some of the best VS Code tricks to make coding faster. Here, I've listed some of the best VS Code tricks that make your coding skills faster.

List of best VS Code Tricks
Select and Rename
Code Snippets
Multi Cursor Selection
Fast Scrolling
Add LogPoints
Select all events of a word
Go to File

  1. Select and Rename


Shortcut Key:: Select + F2

Enter fullscreen mode Exit fullscreen mode

In VS Code rename the functions and variables is a very irritating thing when you are coding for your project. VS Code has feature finds and replaces that is useful for rename. But F2 is also used for rename.

When I learned that F2 is a rename command. I used it for the whole project to rename the variable and functions. Simply select the word you want to change, and press F2 and then write the new correct word. It is one of the best tricks for VS Code.

  1. Code Snippets As a developer, he knows snippets of VS Code for faster coding. When you are working with your project you often create a loop to repeat arrays, then you can create a snippet for it so you never have to type it again. It makes your work easier and faster. You can create snippets for your project and for programming and you can also find them on marketplaces.

I use snippets for common functions and variables which are repeat again and again. Use @category: "snippets" extension for search-only snippets, you can also define keywords after.

Let's see the basic example:
if error != null {
    return error;
}
Enter fullscreen mode Exit fullscreen mode

Here I've listed some snippets
Scope:: It is a comma separator. To enable this snippet you need to use go.
Prefix:: It is one of the snippets.
Body:: You can write your code here.
Description:: A text description that completely understands the logic of coding.
I've also listed some best shortcuts for VS Code to make coding skills faster.

Top comments (0)