visual-studio-code

Multiline comment change


In my VS Code (version 1.99.3 on Ubuntu 24.04 using Python), the multiline comment is Ctrl + K + C and multiline uncomment is Ctrl + K + U, how can I change it to Ctrl + /? Is the only way to install this extension?


Solution

  • I don't know exactly what your extension does, but inserting/removing multi-line comments is natively available. You can also customize the keyboard shortcut without any extension.

    Press the CTRLK then CTRLS keyboard combination. Then search for the "Toggle Line Comment" setting and customize the shortcut.

    Specifically, I'm not sure how CTRLKU and CTRLKC are related here, but if you type "CTRL K U" or "CTRL K C" into the previously mentioned search, you can also customize the keybinding for the corresponding command.