Ctrl+/ shortcut in vscode

Asked

Viewed 164 times

-1

I’m trying to put the shortcut Ctrl + / to comment lines in vscode, but I’m having trouble letting the shortcut complement, ie make the shortcut Ctrl + / add comments and also do the job of removing comments.

Here is part of the snippet of my keybindings.json configuration code:

Where Ctrl+abnt_c1 would be the Ctrl shortcut + /

    {
        "key": "ctrl+abnt_c1",
        "command": "editor.action.addCommentLine",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+abnt_c1",
        "command": "editor.action.removeCommentLine",
        "when": "editorTextFocus && !editorReadonly"
    },

2 answers

1

Hello I believe you are editing the wrong thread. In my case I use ctrl + ;.

Add Comment: Fold All Block Comments editor.foldAllBlockComments

Remove Comments: Toggle Line Comment editor.action.commentLine

You can go on Option Keyboard Shortcuts and seek for comment and assign the shortcut.

  • Ae vlw, now it’s working the way I wanted it to. Abs.

0

Topic solved, I really appreciate the help Ivan Antunes.

My keybindings.json configuration code looks like this now:

    {
        "key": "ctrl+abnt_c1",
        "command": "editor.foldAllBlockComments",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+abnt_c1",
        "command": "editor.action.commentLine",
        "when": "editorTextFocus && !editorReadonly"
    },
  • I’m glad you were able to solve the problem :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.