Visual studio code shortcut for commenting with a german keyboard layout

14.1k Views Asked by At

What is the alternative shortcut for commenting lines on the German keyboard layout in visual studio code?

4

There are 4 best solutions below

3
On BEST ANSWER

The shortcut is: 

STRG + #

I have to type few extra words because stackoverflow doesn't want to have short answers.

2
On

I don't know if it somehow related to my installation, but my vscode uses by default following shortcuts:

Ctrl-K + Ctrl-C - comment
Ctrl-K + Ctrl-U - uncomment

They works with German layout and I can change it to whatever I want using

File -> Preferences -> Keyboard Shortcuts -> Search for "line comment"
1
On

To add to the other answer: if you don't know a shortcut on your keyboard, you can look it up under File -> Preferences -> Keyboard Shortcuts.
Search for the command you want to look up and hover over the blue "i" icon. This will show you the key on your keaboard.

So for your example, you will search for "comment" or something like that and find the mapped key as "ctrl+/" with an blue i icon beneath it. Hover over the icon and it will say: "For your current keyboard layout press Ctrl+#".

More information and how you can fix all the shortcuts for your layout can be found here: VSCode Github Wiki: Keybinding-Issues

Edit: Link to microsofts vscode github wiki changed

1
On

For Mac-Users, it is:

Shift + CMD + 7