Reader small image

You're reading from  Hands-On Visual Studio 2022 - Second Edition

Product typeBook
Published inMar 2024
PublisherPackt
ISBN-139781835080443
Edition2nd Edition
Right arrow
Authors (2):
Hector Uriel Perez Rojas
Hector Uriel Perez Rojas
author image
Hector Uriel Perez Rojas

Hector is an experienced senior developer, with more than 10 years of experience in developing desktop, web, and mobile solutions with the .NET platform. He was recognized with the Microsoft MVP award for two consecutive years in 2021 and 2022. He is an active member of the .NET community and is the founder of El Camino Dev and Devs School academies.
Read more about Hector Uriel Perez Rojas

Miguel Angel Teheran Garcia
Miguel Angel Teheran Garcia
author image
Miguel Angel Teheran Garcia

Miguel Angel Teheran Garcia is a solutions Architect and Technical Lead recognized as a Microsoft MVP, C# corner MVP, and Alibaba Cloud MVP. He is a member of the Avanet community in Medellín and an active member of tech events in Colombia. He has also been a speaker at different conferences around Latin America.
Read more about Miguel Angel Teheran Garcia

View More author details
Right arrow

Learning Keyboard Shortcuts

Throughout this book, we have analyzed some shortcuts that help us improve our productivity, using a combination of some keys to perform common actions in the IDE and source code. VS includes some useful shortcuts by default, but we can also create our own shortcuts, depending on our needs or common operations that we need to perform daily.

In this chapter, we will provide a summary of the most important shortcuts included by default in VS 2022 and explain how to create our own.

We will review the following topics in this chapter:

  • The most-used shortcuts for use in source code
  • The most common shortcuts for use in the IDE
  • Creating custom shortcuts

When working with VS, you must know the relevant keyboard shortcuts so that you can carry out operations quickly. This will prevent you from wasting time on repetitive tasks, such as formatting a complete source code file or renaming a member of a class.

You must put these keyboard...

Technical requirements

Since this chapter focuses on showing shortcuts for use in any project, a base project is not necessary.

It is important to note that different keyboard mapping schemes can completely modify the shortcut keys. In addition, extensions such as ReSharper can modify keyboard shortcuts. To execute all the shortcuts shown in this chapter correctly, you must have a Default keyboard mapping scheme, which can be selected from the Tools | Options | Environment | Keyboard menu.

Let’s enter the world of shortcuts, which will undoubtedly make you become a more efficient and productive programmer.

Shortcuts for use in source code

Working with source code involves working with thousands of lines of code, which can be a headache for even the most experienced developer. That is why the powerful search tools included in VS are an excellent way to search and navigate the lines of code.

Similarly, code editing and refactoring tasks are ongoing in projects, not to mention debugging and testing in large projects.

This is why working with shortcuts that give you instant access to these tools should be a priority in your career as a developer. Let’s see what these keyboard shortcuts are.

Shortcuts for searching and navigating source code

Finding members of a class quickly may seem like a simple task when working on a one-class project, but you may not think so if you work with projects that contain hundreds of classes or even several projects within the same solution. It is during these moments that the following keyboard shortcuts become a great help.

Let’...

The most common shortcuts for use in the IDE

Knowing how to get around in the VS IDE through keyboard shortcuts is an important part of avoiding wasting time searching through menus to activate a specific panel. It is very common, for example, to close the Solution Explorer or Properties window by mistake and not know which menu contains the option to open them again. That is why, in this section, we will examine the shortcuts that speed up the performance of these tasks:

Creating custom shortcuts

We can create shortcuts for specific actions in VS, and there are several options available to customize the current shortcuts.

You can navigate to Tools | Options | Environment | Keyboard to see all the current shortcuts in VS (as shown in Figure 13.1):

Figure 13.1 – The "Keyboard" option for customizing shortcuts

Figure 13.1 – The "Keyboard" option for customizing shortcuts

Here, you will find all the current shortcuts in VS for all the functionalities and a scheme for the shortcuts where you can set them up, depending on the context. By default, VS includes different keyboard schemes with different keyboard shortcut configurations (see Figure 13.2):

Figure 13.2 – Mapping schemes for shortcuts

Figure 13.2 – Mapping schemes for shortcuts

To create a new shortcut, select (Default) under Apply the following additional keyboard mapping scheme, and then select the Analyze.RunDefaultCodeCleanUpOnSolution command from the list. This command executes a process that cleans up code...

Farewell

It’s been a long and exciting road from where we started. In the first section of this book, you learned how to install and adjust VS to suit your needs. We also explored the main templates for different types of projects that you can work with in VS. Similarly, we devoted an entire chapter to analyzing the various available debugging and profiling tools.

In the second section, you learned how to use Code Snippets to quickly create repetitive pieces of code, how to use GitHub Copilot as your programming companion, how to exploit tools for frontend and backend development, how to perform code cleanup, and studied different ways to publish projects for multiple platforms in VS 2022.

Finally, in the third section, you learned about how to integrate VS with GitHub, how to conduct live sessions with your project partners using Live Share, how to work with extensions, the most popular extensions and their uses, and the most important shortcuts that can help you perform...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Hands-On Visual Studio 2022 - Second Edition
Published in: Mar 2024Publisher: PacktISBN-13: 9781835080443
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Authors (2)

author image
Hector Uriel Perez Rojas

Hector is an experienced senior developer, with more than 10 years of experience in developing desktop, web, and mobile solutions with the .NET platform. He was recognized with the Microsoft MVP award for two consecutive years in 2021 and 2022. He is an active member of the .NET community and is the founder of El Camino Dev and Devs School academies.
Read more about Hector Uriel Perez Rojas

author image
Miguel Angel Teheran Garcia

Miguel Angel Teheran Garcia is a solutions Architect and Technical Lead recognized as a Microsoft MVP, C# corner MVP, and Alibaba Cloud MVP. He is a member of the Avanet community in Medellín and an active member of tech events in Colombia. He has also been a speaker at different conferences around Latin America.
Read more about Miguel Angel Teheran Garcia

Shortcut

Description

Ctrl + [ + S

Selects an open file in the Solution Explorer window quickly

Ctrl + Alt + L

Activates the Solution Explorer window

Ctrl + Alt + O

Activates the Output window

Ctrl + \, E

Activates the Error List window...