Read: How to debug in visual studio? (Tutorial to debug C# code)Ĭtrl+K+S to automatically add condition using shortcut " Ctrl+Shift+B" shortcut will build your solution, which is widely used by C#/.NET developers Open Solution ExplorerĬlick " Ctrl+W, Cltrl+S" to open solution explorer. In Visual Studio 2019 while holding down " Ctrl + Alt + ↑ / ↓", you can edit multiple lines Build Solution Yes, you can type on multiple lines at once using Visual Studio, here is the shortcut of this : Shift + Alt + ↑ / ↓ (use up arrow to select upper code lines from current selected line, and down arraow to select lower code lines) If you are working with Visual Studio from quite some time, then you must have seen there is "+" ( when code is collapsed) and "-" ( when code is alread expanded) sign, in your code which let's you expand or collapse your classes/methods code, you can collapse all the regions of the file by clicking " Ctrl+M, Ctrl+O" in Visual Studio. You can use " Ctrl+K, Ctrl+U" to uncomment the selected code Collapse all code regions In Visual Studio: Ctrl+K+C will comment, Ctrl+K+U Will uncomment multiple lines of selected code at once. Just go to "Edit -> Advanced" and select "Comment Selection" or "UnComment Selection" Comment multiple lines of code If you can't remember the shortcut, you can always use the "Edit" menu. Take a look the below image, which shows how code is commented and then uncommented using Visual Studio keyboard shortcuts " Ctrl-K, Ctrl-C", to comment out the current selected lines in Visual Studio, it is one of the widely used shortcuts, since we keep commenting out code while code. In Mac OS, we can use COMMAND + / for commenting and uncommenting for single line in VS Code.īest IDE for Web-developement(C#, ASP.NET, PHP, Java, HTML, CSS)īest Source Code Management tools (Version Control tools)īest Project Management Software (Scrum tools) to use.Visual Studio is one of the best IDE for software developers and mostly preferred by C#.NET developers, so in this article, I have provided useful shortcuts to be used in Visual Studio like comments shortcut, collapse or expand code region etc.Remove a line comment Ctrl+K, Ctrl+U (Windows).Add a Line comment Ctrl+K, Ctrl+C (Windows).You can use following shorcuts to comment single line code in Visual Studio(VS) Code: On Ubuntu - Ctrl + Shift + I Comment Single line Code in VS Code.I would like to mention another useful shortcut for VS Code, which is to format code: You can search through the list both by keybindings (key names) and command names, and update them according to what you like. MacOS : Code -> Preferences -> Keyboard Shortcuts.Windows : File -> Preferences -> Keyboard Shortcuts.You can also customise the comment shortcuts in VS Code. Usually, as you can see from above shortcuts in VS Code comment shortcuts, Mac is very similar to the Windows version. Simply use 'Ctrl + /' for commenting and uncommenting code in VS Code Windows and To toggle a block comment, execute (SHIFT + ALT + A) You can use CMD + K + C to comment multiple linesĬMD + K + U to uncomment multiple lines. You can also CTRL + K and then CTRL + C to comment multiple linesįor uncommenting multiple lines you can use CTRL + K then CTRL + U On Ubuntu, the shortcut is Ctrl + Shift + A, similar to Mac. Then you can simply click on "Alt+Shift+A" in Windows or "Ctrl + Shift +A" in Mac to comment or uncomment selected lines, as you can see in given image.Select a block of code using your mouse or keyboard If the file is already opened in Visual Studio Code.Here are the simple steps, to comment out or uncomment multiple lines of code in Visual Studio Code IDE. Comment out multiple lines of selected code Method:1 In previous article, I have mentioned Useful Visual Studio Shortcuts (comment, remove comment, Collapse code etc ) but in this article, I have mentioned how to comment out multiple lines in Visual Studio Code.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |