Customise VS Code settings and keybindings with Geddski macros

In IntelliJ IDEA, you can comment a line, the cursor is moved to the next line automatically. This is a very easy way to comment several lines. However, in VS Code, default behaviour is that the cursor stays on the same line.

To copy the behavior of IntelliJ, go with:

  • Install macros author by geddski in VS Code.

  • Edit settings.json and add:

1
2
3
4
5
6
"macros": {
"commentDown": [
"editor.action.commentLine",
"cursorDown"
]
},
  • Edit keybindings.json and add:
1
2
3
4
5
6
7
[
{
"key": "cmd+/",
"command": "macros.commentDown",
"when": "editorTextFocus && !editorReadonly"
}
]

Contents