Developer Productivity By Visual Studio Shortcuts

Playing with keyboard shortcuts is very interesting and reduces the headache of using the mouse again and again while programming with Visual Studio IDE. There are some very useful hotkeys which can increase our productivity significantly.

So, I decided to share a list of Visual Studio keyboard shortcuts that are amazing and very helpful.

  1. While code review I found scattered and unaligned code many times which we all hate. I used CTRL+K+D to align it. The left side of my code is scattered, so first I selected the area of code and then applied CTRL+K+D.
    Code review
  2. Use F12 to go to the definition of class. Use CTRL- to go back.
  3. Resolve the classes and use CTRL+.
  4. Refactoring is very important. Use CTRL+R+M for extracting a method.
  5. Want to put a few lines of code in the try block. Try Ctrl + K + S.
    Lines of code
    It provides a lot of options.
  6. Ever tried selecting a rectangle code? Use ALT and click drag.
  7. Lots of code in a single file. Use CTRL + M + O and CTRL + M + X in the collapse/expand code groups like regions, and methods.
  8. Lots of code and there are no groups. Use CTRL+M+H/CTRL+M+U.
  9. Create a new Class using CLS and press TAB twice, or
  10. Create a constructor using CTOR and press TAB twice.
  11. Create properties using PROP and press TAB twice.
    Use PROP press
  12. Create for loop using CTRL+K+S, then go to foreach and press Enter or TAB.
    Create for loop
  13. Write the full property definition that we used earlier to C# 3.0, then use propfull, and press TAB twice.
    Create a properties
  14. Create switch block, use switch, press TAB twice
    Switch
  15. Write our own custom exception class that should inherit from the Exception class.
    Exception press TAB twice.
  16. Write console.writeline, use cw, and press TAB twice.
  17. Show the horizontal space by dot using CTRL+R, CTRL+W
  18. Remove the Horizontal space, CTRL+ K, CTRL+ \
  19. Shifting the code left side use Shift +Tab
  20. Shifting code to right side use, select the code, and use Tab

This is not the complete list but very common ones that can be used a lot in our day-to-day coding.

I hope you like this. Have a good day. Thank you for reading.


Similar Articles