Five shortcuts to boost your productivity

Mads Kristensen

Taking full advantage of the Visual Studio editor features will make you a more productive developer. Any keyboard warrior will tell you that knowing the right shortcuts boosts that productivity even further. So, we’ve put together a short little video that demonstrates some useful shortcuts you can use while coding in Visual Studio.

In the video, we cover the following shortcuts:

Ctrl + D Duplicate lines
Ctrl + Shift + L Delete whole line
Shift + Alt + . Select next occurrence
Alt + select Vertical (box) selection
Alt + Ctrl + mouse-click Insert multiple cursors

There are many other features for editing your code. One way to discover them is to look in the Edit menu.

Image edit menu

Happy coding!

17 comments

Discussion is closed. Login to edit/delete existing comments.

  • Max Mustermueller 1

    Is there any shortcut to select the whole string (everything between double quotes)? I’ve tried both expand selection options in the screenshot but they select much more than I want.

    • Oscar Vargas 0

      double click on it

      • Nikolai Vorontsov 0

        it selects only single word. sometimes it’s necessary to select the whole phrase (with spaces) in quotes. I use mouse in this case.

        • Moreno Sirotić 0

          Triple click selects whole sentence

          • Michael Coffey 0

            This does not respect double quotes, selects entire line.

    • Ondřej Kubíček 0

      Have you tried Edit.ExpandSelection? For me it is Shift+Alt+=
      Or what file are you editing?

    • Alexander Dubinin 0

      Tools –> Environment –> Keyboard
      shortcut:
      Edit.SelectCurrentWord

      if pressed multiple times, it selects more things in the current line.

      example: (if your curser is between the mm)
      var text = “hh-mm-ss”;

      1. selects mm
      2. selects hh-mm-ss
      3. selects “hh-mm-ss”
      4. selects var text = “hh-mm-ss”

  • Wouter de Vries 3

    I use Shift-Delete to remove lines, although it actually cuts them into the clipboard. Great when refactoring code and lines of code need to move.

    Alt-Up and Alt-Down to move the current line or selected lines up or down are similarly great.

    • Mads KristensenMicrosoft employee 2

      I used to use Shift+Delete until I learned about Shift+Ctrl+Delete. Most of the time, I do not wish the deleted line overriding my clipboard.

      Alt+up/down is a lifesaver too. Don’t know how I could have forgot to put that in the video 🙂

      • Brian Baker 3

        Windows clipboard history (Win+V) helps somewhat there.

  • Uwe Keim 2

    OT: Will Visual Studio ever get a mayor rewrite so that it matches the performance of e.g. Rider? I still cannot believe that a Java application is actually so much faster and so much more responsive than a Windows application.

  • Brian Baker 0

    Good tips! It would be nice if the full screen option worked on the embedded YouTube player.

  • John Whorfin 1

    In flagship Visual Studio 2022 for Windows, what’s the shortcut to turn-on the line length guidelines (the one that marks, for example, an 80 character line) in the editor?

  • Ondřej Kubíček 0

    What about Ctrl + Shift + (Left/Right) Arrow? I use it a lot when positioning multiple carets in different length named properties. Or simply to faster select method name or faster horizontal navigation.

    btw. In table could be the full command name used in Options/Keyboard (eg. Edit.InsertNextMatchingCaret = Select next occurence) in case someone would like to change it or the default one is unmapped for some reason.

  • Helder Oliveira 2

    Sorry by the sidestep: I use Visual Studio 2022 preview. Today it started spell checking variable names and giving hundreds of spell check warnings.

    In this blog on the image that shows the shortcuts (Edit/Advanced) theres an opcion for toggle spell check. I don’t have that option.

    My instal is up to date. How can i toggle spell check?

    Thanks!

Feedback usabilla icon