Tutorial hero
Lesson icon

Keyboard Shortcuts

Originally published October 13, 2022 Time 2 mins

I don’t want to be one of those people, but I’ve been putting a lot more emphasis on using my keyboard and not my mouse over the past couple of years.

I’ve tried to incorporate as many keyboard shortcuts as I can into my workflow, but there have been a few that I use constantly every day in VS Code.

The tip this week is going to recap the keyboard shortcuts I make use of most frequently.

It’s worth noting that I have a pretty out there keyboard layout, so you might want to adapt some of these keybinding to better suit your workflow.

F12 (Go to definition): This will open the definition for whatever your cursor is currently over. Let’s say you are in the HomeComponent and you are calling some method like this.userService.getUser() - hitting F12 will automatically open the file where getUser() is defined.

F8 (Go to next error/issue/warning): This will allow you to quickly jump to the next issue.

Cmd K + Cmd I (Debug: Show hover): If you have your cursor over an error you can press this combination to show the details of the error.

Cmd + . (Quick Fix…): Bring up the quick fix menu, great for imports and auto fixing errors.

Cmd + P (Go to File…): You can use this to search for a file, and then you can also just type ”>” to start typing commands.

Cmd + N (File: New File…): Create a new file in the explorer.

Cmd + Shift + N (File: New Folder…): Create a new folder in the explorer.

Cmd + Shift + [: Switch to tab to left

Cmd + Shift + ]: Switch to tab to right

F6 (View: Focus Next Part): This will cycle between parts of the UI - for example if you are in the code editor and hit F6 it will take you to the terminal (if it is open), and then the Explorer, and so on.

Shift + F6 (View: Focus Previous Part): Same, but in the opposite direction

Cmd + W: Close current window

Cmd + Opt + T: Close others

These are still a few more that I use quite often, but this is most of the common ones. If you also want to start using the keyboard more, try just adding a few of these to your workflow at a time until it becomes second nature.

Learn to build modern Angular apps with my course