![]() Find "Toggle Line Comment" and click on the pencil icon to edit it. Type in "keyboard" and select "Preferences: Open Keyboard Shortcuts"ģ. If for some reason you want to change the default key binds for commenting and uncommenting in VS Code, you can follow these steps: 1. Changing the comment key binds in VS Code unless of course you rebound the slash shortcut to do something else. ![]() Like I said, I think these commands are a lot less handy, and I don't think there's ever a good reason to them over the slash one. So, if you keep executing (CTRL + K + C), the comments will keep piling up, as shown in the screenshot below. How To Auto Format Code in Visual Studio 2022 Format Entire Document CTRL-E, D Document Formatting Example Before and After Format Selection CTRL-E, F. They do not toggle code like the slash shortcut. Weird formatting when saving react project file in vscode. The main difference with these commands is that they each only have a single purpose. Visual studio code changes format (React-JSX) Ask Question Asked 6 years ago. There's one other way to comment and un-comment, but it's not as handy.Ĭomment out code (): ![]() To toggle a VSCode comment block, you can use : If you want to comment out multiple lines of code within the same comment, this is what you're looking for. These are comments which span multiple lines of code (a block). Some programming languages support block comments. I use this command constantly and can't imagine not having it. Once you do it a few times it will become muscle memory and boost your productivity. Select the code that is currently commented-out and execute the shortcut. You can also uncomment using the same command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |