![]() 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 place the caret at this line, press Alt+Enter and choose Uncomment. I want to share two shortcuts to do it in the Windows OS. If there is a selection, ReSharper will comment or uncomment all the lines that the selection spans. Visual Studio Code has the possibility to comment and uncomment the single line code and multiple lines. If no lines are selected comments will be added (or removed). Ctrl+K Ctrl+C Add line comment Ctrl+K Ctrl+U Remove line comment Ctrl+/ Toggle line comment Shift+Alt+A Toggle block comment Alt+Z Toggle word wrap Navigation Ctrl+T Show all Symbols Ctrl+G Go to Line. ![]() 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 ). Commenting out code In the C/C++ editor, select the line(s) of code that you want to comment out. or by going to View > Appearance > Toggle Zen Mode. ![]() You can activate Zen mode with: Windows: Ctrl+K Z. In C files, additional levels of line comments can be added, which allows regions of codes to be commented. Zen mode is a distraction-free view, allowing you to focus completely on your code and hide all the toolbars and buttons. These methods can be used to comment and uncomment sections of code. Use the cmd + / key binding on the selected code. ![]() 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. To comment out an entire block of code: Select the code and select Toggle Line Comment (s) from the context menu. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |