VS Code Tips
Tips for using VS Code
Rather than adding
//to the start of each line manually, VS Code has a shortcut that allows us to comment out multiple lines simultaneously. To do this, select all lines we wish to comment out, then use the keyboard shortcut
Ctrl+/on Windows, or
Sometimes we want to change the name of a variable in our code, a common practice in refactoring. If that variable is used in multiple places, we may be tempted to edit each instance individually. Luckily VS Code has a convenient feature that allows us to edit all instances of the same variable simultaneously, saving time and our fingers.
- 1.Move your cursor to the first instance of the variable
Ctrl+Don Windows or
Cmd+Don Mac until all instances of that variable are selected
- 3.Use left or right arrow keys to enable cursors on each instance of that variable and edit them simultaneously
The VS Code minimap is displayed by default in VS Code to show one's vertical position within a file. This may not be necessary and we can hide the minimap for more space in VS Code. Hide the minimap by toggling View > Show Minimap in the menu bar.