mindervur.blogg.se

Visual studio code python comment shortcut
Visual studio code python comment shortcut




visual studio code python comment shortcut

PS: I prefer Ctrl+ Shift+ / for toggling block comments because Ctrl+ / is shortcut for toggling line comments so its naturally easier to remember. Here you can find all the keyboard shortcuts. Visual Studio Shortcuts: Comment Selection / Uncom.How to comment multiple lines in Visual Studio Code?.This might lead you to believe that Ctrl+K is the old way of doing things and we should use Ctrl+E.īut in Visual Studio Code, the comment/uncomment functions are bound to " Ctrl+K" (from Visual Studio Code Key Bindings): You'll notice that the menu items in Visual Studio all have " Ctrl+E". In addition "Ctrl+K" starts off "insert snippet" or " Surround With", so that's less for me to try to remember. I'm used to using " Ctrl+K" to start off the shortcuts (whether formatting documents or commenting/uncommenting), so that's my current habit. Currently, both keybindings work (again with the default C# settings). You may have noticed that in this and the previous article about Format Document, we have the option of using " Ctrl+K" or " Ctrl+E" to start off the command.

visual studio code python comment shortcut

Otherwise, we'll end up commenting out an opening or closing tag, and we'll be left with an unbalanced comment. If the delimited comments span multiple lines, then we want to make sure to include the entire delimited comment in the selection. One thing to watch out for is when using the delimited-comment notation ( /* */ ) in our code. This means that if you then uncomment the same block, you will end up with the original code (including the original single-line comments). If a line already has a single-line comment, then the comment notations will be doubled-up.

visual studio code python comment shortcut

This means that it will work in most situations. As you can see, this uses the single-line comment notation (the //).






Visual studio code python comment shortcut