Making VSCode like IntelliJ after line commented the cursor automatically moved to next line

Want to make VSCode key bindings as closed as IntelliJ key bindings like.

Firstly, install VSCode extension macros.

macros

Open Code -> Preferences -> Settings. Add following configuration into User Settings.

1
2
3
4
5
6
"macros": {
"commentLine": [
"editor.action.commentLine",
"cursorDown"
]
}

User Settings

Open Code -> Preferences -> Keyboard Shortcuts. Add following configuration into keybindings.json file.

1
2
3
4
5
6
7
8
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+/",
"command": "macros.commentLine",
"when": "editorTextFocus && !editorReadonly"
}
]

keybindings.json

That’s newly added Toggle Line Comment looks like after the change:

Toggle Line Comment

Contents