Improve productivity using visual studio a detailed guide Updated 2022

    By: Manu
    1 year ago

    In this guide we are going to talk about Visual studio shortcuts which can save a-lot of your development time and make you more productive. so let's get started

    here are few of the most used command short cuts.


    Windows And Mac Command Keys


    Check Complete list Key mapping Windows-MacOS


    Open Command Prompt


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    Command and P key.
    



    Switch Between tabs


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Switch between opened tabs using
    
    Control and 1 // Open First Tab
    Control and 2 // Open Second Tab
    Control and nth // Open n number Tab
    


    Go to specific file / Search a specific file in whole project


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Go to specific file / Search a specific file
    
    Command and p  // To open Command pallet and type file name, It should display in dropdown.
    



    Go to specific function / Search a specific function in a file


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Go to specific function / Search a specific function in whole project
    
    Command and p  // To open Command pallet and type # and then function name. like 
    
    #functionNameGoesHere
    
    // You should see function in drop down
    
    or try
    
    @functionNameGoesHere
    


    Close tabs one by one / Or all at once


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Close tabs one by one / Or all at once
    
    Command and w   // This will close open tabs one by one.(Current one closed First)
    
    Command and k and w  // This will close all tabs at once.
    


    Toggle Sidebar in Visual studio code


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Toggle Sidebar in Visual studio code
    
    Command and b
    


    Change Font of code in Visual studio code


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    Command +  // Increase font size
    Command -  // Decrease font size
    


    Open 2 files Side By Side in Visual studio code


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Open one of the file you want to open and do
    
    // This will open a new window and then you can work on 2 files. 
    
    Command and \  
    


    Go to start or end of line


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    Command and -> // Go to extereme right of the line.
    Command and <- // Go to extereme left of the line.
    


    Move left right word by word in line.


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    Shift and Option and -> // Move right word by word.
    Shift and Option and <- // Move left word by word.
    


    Duplicate code line


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Go to the code line and then press
    
    Shift and Option and down key // Will create a duplicate in new line like copy paste
    


    Find and replace


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    Command and Option and F key
    
    // Put keywords as you like in fields Find and replace
    


    Select all occurrences one by one


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Select a keyword and press these keys
    
    Command and d
    


    Edit or add content same content in multiple lines


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Press and hold Option key and click where ever you want to add text.
    
    At last type code or text will be added to all places where you had cursors placed.
    


    Move code up or down


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    // Go to code line or select code block and then press
    
    Option key and down or up arrow
    


    Jump to specific line number


    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    Commnd and G key // Then type line number and hit return(Enter).
    


    Find about function or variable



    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    Press and hold Command key and hover over function or variable name. // This will display you the properties there.
    


    Open terminal in visual studio

    **** These are MacOs Keys, Refer to image in this post for windows keys. ****
    
    Command and ` 
    
    ` // Means backtick key