17 Best VS Code Tips and Tricks


A list of useful tips and tricks for using the code editor as well as how to perform a good setup with it.

This article is a collection of tips, tricks, hacks, tweaks, and goodness that I have picked up over the years while working with VS Code. It’s aimed at developers who are already familiar with VS Code and want to take their productivity to the next level.

If you don’t have any prior experience with VS Code, you can still get a lot out of this article. Just make sure you read the first few sections carefully — especially how to install extensions!

VS Code has a diverse list of extensions, one of the reasons why it is so popular. This is a list of useful tips and tricks for using the code editor as well as how to perform a good setup with it. There are also various shortcuts and commands that can be used to make things easier and faster. If you know any other useful tips and tricks or if you have any questions, feel free to leave a comment below.

If you want to save time, you should use keyboard shortcuts instead of moving your mouse to click on buttons in the user interface. Most of them are already set by default but there are some that may need to be assigned manually in order for them to work. To assign a keyboard shortcut, go to File > Preferences > Keyboard Shortcuts (Code > Preferences > Keyboard Shortcuts on Mac) menu. You can find code snippets under File > Preferences > User Snippets menu.

Various useful shortcuts:

Ctrl + P (Cmd + P): Go To File…

Ctrl + Shift + P (Cmd + Shift + P): Command Palette

Ctrl + Shift + N (Cmd + Opt + N): New window/instance…

Ctrl + W (Cmd + W): Close window/instance

Ctrl + , (Cmd +

One of the most popular text editors used for coding is Microsoft’s Visual Studio Code which has many different features that other text editors don’t have. VS Code also supports remote development, which allows you to use a container, remote machine, or the Windows Subsystem for Linux (WSL) as a full-featured development environment.

VS Code can be downloaded for free from the official website and it is available on Windows, OS X and Linux. If you are looking for some VS Code tips and tricks, this article will help you. We will show 17 VS Code tips and tricks that you should know in 2020.

Let’s begin!

1. Markdown Preview

2. Open Multiple Files at Once

3. Find and Replace Across All Open Files

4. Clickable Hyperlinks

5. Show Git Branch in Status Bar

6. Close All Tabs to the Left (or Right)

7. Split Terminal Panes Vertically and Horizontally

8. Open a Terminal in the Current File’s Folder

9. Access Terminal Commands from the Editor with Code Runner

10. Create Custom Snippets for Faster Coding

11. Create Multiple Cursors Using Keyboard Shortcuts

12. Select a Word, Line, or Entire Code Block Using Keyboard Shortcuts

13. Undo Closing a Tab with Ctrl + Shift + T on Windows or Command + Shift + T on MacOS

14. Use Emmet Abbreviations to Speed Up Code Writing in HTML and CSS Files

15. Change Themes to Make VS Code Look Even Cooler!

16. View Documentation for Functions, Methods, etc by Pressing F1 or Ctrl + K followed by F1 (Windows) or Command + K followed by F1 (MacOS) after highlighting them in the code editor window when using a language like Python, JavaScript, ReactJS, etc that VS Code

I have been a fan of Visual Studio Code since the day I started using it. So, I thought of writing a small list of (hidden) tips and tricks that can make your life easier when working with this great editor.

My goal is to keep this list updated as I come across new tips and tricks myself. So let’s get started!

I’m not going to talk about the basic shortcuts or preferences, but rather the lesser known ones.

First, let’s take a look at the SSH configuration in VS Code. To do so, open the Command Palette (F1 or Ctrl + Shift + P), and type ‘SSH Config’.

You will see two options:

Open SSH Config

Add new SSH Host

Open SSH Config will open the file where you can change the configuration manually, and Add new SSH Host will open a form to add a new host by specifying hostname and username.

1. File Explorer

Open File Explorer with the shortcut ⌘ + Shift + E or by clicking on the icon in the Activity Bar. You can then use your keyboard arrows to navigate through files and folders.

2. Open Recent Files

You can quickly open recent files using the shortcut ⌘ + P, then type @ and use your keyboard arrows to navigate through the list of recent files.

3. Create New Files and Folders

To create a new file or a new folder in File Explorer you need to right click in an empty space and select New File or New Folder. Alternatively you can also use the commands explorerCreateFile and explorerCreateFolder from Command Palette (⌘ + Shift + P).

4. Rename Files and Folders

To rename a file or a folder in File Explorer you need to right click on it and select Rename from the drop-down menu that appears. Alternatively you can press F2 while having it selected.

5. Cut, Copy, Paste, Duplicate, Delete Files and Folders

You can perform all these operations by right-clicking on a file or folder in the Explorer but there are also shortcuts for each of them:

Cut: ⌘ + X

Copy


Leave a Reply

Your email address will not be published. Required fields are marked *