![visual studio code comment shortcut visual studio code comment shortcut](https://3.bp.blogspot.com/-NuZ1kB3Fir4/WO88BUzTSjI/AAAAAAAAEOc/z8sKNsa4WigL5bULglVWqvE64Ef--LqiwCLcB/w1200-h630-p-k-no-nu/VSKeyboard.jpg)
Even if a line is partly selected, the comment mark is inserted in the beginning of this line.Īn alternative way to uncomment any line comment is to set the caret at this line, press Alt+Enter and choose Uncomment. These methods can be used to comment and uncomment sections of code. It offers various shortcuts and features to help you add, select, copy, move, edit, fold, find occurrences. To comment out an entire block of code: Select the code and select Toggle Line Comment (s) from the context menu OR Use the cmd + / key binding on the selected code. If there is a selection, ReSharper will comment or uncomment all the lines that the selection spans. Port of IntelliJ IDEA key bindings for VS Code.
![visual studio code comment shortcut visual studio code comment shortcut](https://i.stack.imgur.com/t7k47.jpg)
You can configure this option for different languages separately, for example, for C# it is on the Code Editing | C# | Formatting Style | Tabs, Indents, Alignment page of ReSharper options ( Alt+R, O). If there is no selection, ReSharper will comment the current line, or uncomment if the line is commented, and moves the caret to the next line.Īccording to the Don't indent comments started at first column option, the comment will be added with or without the indent. Editing Shortcuts Ctrl+K, then Ctrl+U Remove line comment Ctrl+K, then Ctrl+T Change theme Ctrl+/.