Sitemap

Visual Studio — Tips to Increase Productivity

4 min readApr 2, 2024

--

Press enter or click to view image in full size

⚠️ This article has moved to my website.

You can read the latest version here:
👉 https://henriquesd.com/articles/visual-studio-tips-to-increase-productivity

Below is a short preview of the article.

Visual Studio offers several features and shortcuts that provide a better coding experience. In this article, I present some tips that will increase your productivity when using Visual Studio.

I’ve been working with Visual Studio for more than 10 years, and during these years I learned some useful shortcuts and features that help me in my working day. Below you will find an enumerated list of all the features/shortcuts presented in this article. Many of them I use daily, and others not so frequently. May these tips serve you well.

1. Search a file by name
2. Minimize and Maximize all methods in a class
3. Comment and uncomment multiple lines
4. Move a code line to another line
5. Go to a method implementation
6. Automatically format the code
7. Code snippets
8. Renaming a method or a class
9. Go to a specific line
10. Bookmarks
11. Find or Replace
12. Build the project
13. Debug shortcuts
14. Save all files
15. Fullscreen mode
16. Quick action
17. Immediate window
18. Add Watch
19. Quick Watch
20. Call Stack Window
21. Find all the references
22. Organize and remove usings
23. Automatically implement interface methods
24. Minimize all items in the solution
25. Opening the Solution Explorer
26. Surronding a code
27. Automatically create a method based on the code
28. Delete/Disable all breakpoints
29. Add a new project
30. Cut the whole line
31. Extracting a method
32. Properties window
33. Error List window
34. Track a file in the solution
35. Automatically launch a Web App using an incognito page
36. Vertical selection
37. Change multiple lines at once
38. Update multiple text/variables at once
39. Navigating between open files
40. Closing a window
41. Automatically breaking a line
42. Go to your last code change
43. Paste JSON as a class
44. GitHub Copilot Chat

1. Search a file by name

Searching for files or navigating between the folders within a large project can be time-consuming. However, Visual Studio provides an easy way to swiftly locate any file, type, or member within your project, for that you can press Ctrl + , or Ctrl + T and easily search for the name or part of the name:

Press enter or click to view image in full size

Alternatively, you can also use Ctrl + 1 + F/T/M to search for a specific file, type or member. For example, Ctrl + 1 + F will open this window that searches for a specific file:

2. Minimize and Maximize all methods in a class

VS provides an efficient way to manage the visibility of methods within a class. This is specially useful in classes where you have a series of methods. With Ctrl + M + Oyou can minimize all methods in a class:

Press enter or click to view image in full size

With Ctrl + M + L you can maximise all the methods:

Press enter or click to view image in full size

3. Comment and uncomment multiple lines

To comment multiples lines at once, highlight the lines you want to comment out and pres Ctrl + K + C:

Press enter or click to view image in full size

To uncomment, press Ctrl + K + U:

Press enter or click to view image in full size

4. Move a code line to another line

If you need to move one line of code to another line, you can keep the mouse on the line you want to move, and then press Alt + Up/Down arrow:

Before
After

5. Go to a method implementation

When you want to navigate to a method implementation, if you press the key F12 you will be redirected to the interface, for example:

👉 Continue reading the full article here: https://henriquesd.com/articles/visual-studio-tips-to-increase-productivity

--

--