Shortcuts keys in Visual Studio:

This blog is specifically about Shortcuts keys in Visual Studio. In my starting days as a developer when I was getting started with visual studio I used to work manually with the mouse but after some experience, I learned how shortcut keys and extensions like Productivity Power tools, Resharper can improvise you productivity and coding skills. I have to spend a lot of time using a mouse and navigating here and there just to perform the respective operation. As we know Visual Studio is the smart IDE which has the capability to run all the functionality with the keyboard you don’t need to use your mouse to the work. The blog will focus o

n how to learn the productive shortcuts which will help us during our development cycle and amaze your fellow colleague. Share the learning, I will be updating this article as much as I can with lots of features.

  1. Text Navigation:

In line number 13 if I want to navigate to right side words, I will try using right arrow and traverse through each character. Let’s see what happens when I press ctrl key along with right and left arrow. You will see we are able to traverse one word at a time which is quite faster as compared to traversing through each character to reach to the desired word.

pic1

If we want to go to the end of the line and select the text we can use the Shift+ End Key and vice versa for Home.

2.0 Going to end or Starting off the page:

What if our code is too lengthy to be shown on our desktop screen, so in order to scroll position using the keyboard, we should use the down arrow, in another scenario we can use below shortcuts

Shortcuts PageDown and PageUp for Scroll down/ Scroll Up
and Ctrl + End and Ctrl+ Home
for jumping to the end of the file or beginning of the file.

3.0 Text Selection

In order to select the statement of a line, we would use the same shortcut as discussed in 1.0 but we will add one more key to the shortcut in order to Select the text.

We will use Shift+Ctrl+Right or Left arrow for selecting the forward or left word as shown below:

pic2

In order to select the whole one line statement we will simply use Shift+End or Shift+Home as shown below:

pic3

Deleting the whole line:

What if we want to delete the whole line of code. In order to achieve the same, we will just go to the line number and press Ctrl +X or Ctrl +L as shown below:

step5

Deleting One character to the right side: In order delete one character at a time to the right side of the word just use Delete. In case you want to delete to the left side of the word use the Backspace key.

Deleting the word using Backspace or Delete is quite slow so in order to speed up the deletion procedure we will follow some other shortcut for the same as mentioned below:

So as we discussed the selecting of a word using Ctrl key we will use the Ctrl key for deletion as well, just select the word and put the cursor over it press Ctrl key over it and then press Delete as shown below:

step7

Commenting Your Code:

In order to comment your selection, you should just select your multiline code and just press Ctrl+K and Ctrl+C as shown below:

step8

Removing the Comment

In order to remove the comment that you have selected just type Ctrl+K and Ctrl+U.

step9.gif

Bookmarks

I have not heard of bookmarks unless I went through blogs and articles on tips and tricks of Visual studio and found it quite useful. So Bookmarks in visual studio allow us to bookmark the various part of the code to remind yourself that you need to check this code once you are done with some priority changes in other files.

For a while I am working on my another class and want to bookmark my main method so I would just type Ctrl+k+k the bookmark will be attached to the line as mentioned below:


In order to see all the bookmarks, we will press Ctrl+K +W

step11.gif

Rename the bookmark as per your understanding, once you press Ctrl+K+W press Menu keys

step12.gif

Creating shortcut in visual studio

In this example,  I am going to show you how to create a shortcut of Package Manager Console in Visual Studio.

  • Go to Options
  • Keyboard

1

Type PackageManager inside “Show Command” containing as shown below:

2

Press the shortcut keys that you want to assign as shown below:

3

Click on Assign and you are ready to go.

Acknowledgements

Hey, folks, i will be updating this blog as soon as possible till then try these few shortcuts and improvise your productivity. Meanwhile, you can also watch below video tutorial for more shortcuts and tips/ tricks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: