How to comment in Visual Studio Code like in Notepad++? - visual-studio-code

In Notepad++ I always select the part I want to comment then right click -> block comment. But I can't do it in Visual Studio Code.
Is there a way (or extension) to do this?

CTRL + /
Is used to line or block comment.

Related

How do I prevent autocomplete on spacebar in Visual Studio Code (VS Code)?

In Visual Studio Code when a highlighted quick suggestion appears, if I press SPACE, the suggestion is accepted and auto-completed.
How do I disable this feature so autocomplete only occurs on TAB and ENTER (the other default completion keybinds as of 2022.7.16)?
Add the following line to your VS Code settings JSON file.
"editor.acceptSuggestionOnCommitCharacter": false
Sourced from a similiar question about Visual Studio - source answer.

How to change occurence in same line with Visual Studio Code?

I recently watch a tutorial on youtube. The guy somehow can change the same word in a same line on visual studio code. Is there any shortcut to do so? Or maybe it's an extension?
It is occurrence. You can add keymap for it just search for "occurrence".
You can "add next occurrence" something like that and it will select next occurrences to your selection and you can change it.
I have same thing in PHPStorm, it is called something like "Add Next Occurrences".

How can I "Add Next Occurrence" in Visual Studio for Mac?

In Visual Studio Code and Sublime Text there is functionality called "Add Next Occurrence" that selects next occurrence of marked text. The keyboard shortcut for utilizing this function is CMD+D (CTRL+D on Windows and Linux).
This function would select the next occurrence of the text and also add another cursor to the end of the newly selected text.
How can I achieve this in Visual Studio for Mac?
The shortcut is: ⇧ + ⌥ + .
(Shift + Option + .)
And its name in the settings is: "Insert next matching caret"
At the moment this answer is the only one working for Visual Studio (tested in 8.9). All the others are for Visual Studio Code.
Unfortunately, this is not currently supported. There is however an open suggestion to the team that you can up-vote if you would like to see this feature in an upcoming release.
Here is the link to the feature request: https://developercommunity.visualstudio.com/content/idea/351843/multiple-selection-with-the-keyboard.html
In Mac, CMD + D will do the job.

How to stop copying the white space, on a blank line, in Visual Studio Code?

In visual studio code, if you press ctrl + c on a blank line, with nothing highlighted, it copies the blank line.
I thought there may was an option to disable this, but haven't been able to find it.
You should be able to do this by configuring the option editor.emptySelectionClipboard to false.
There is an extension for it:
https://marketplace.visualstudio.com/items?itemName=usernamehw.do-not-copy-empty

How do you auto import libraries in Visual Studio Code?

Usually in IntelliJ you have a shortcut for auto importing libraries.
Is there an equivalent for Visual Studio Code?
In the current version, 1.11.2, you can put your cursor in the error line.
You will see a bulb in the line number. Then click it or press the shortcut ⌘ + . (Quick Fix).
That will pop up a import hint window, as follows
Currently there is no support for this in Visual Studio Code, but it's a good idea for an extension.