DEV Community

Marcos RJJunior
Marcos RJJunior

Posted on

3 Tricks on VS Code

I've been using the first one since the last update.

The options are very minimal, but really helpful !! let me know how do you feel using them.

Enabling bracket pair colorization

"editor.bracketPairColorization.enabled": true,
Enter fullscreen mode Exit fullscreen mode

bracket pair colorization

Enabling Auto complete your sentence

"editor.suggest.preview": true,
Enter fullscreen mode Exit fullscreen mode

auto complete sentence

Sorting code

{
    "key": "shift+alt+s",
    "command": "editor.action.sortLinesAscending"
}
Enter fullscreen mode Exit fullscreen mode

Running multiple actions using macros

Because this is still not native feature, I'm using the macros extension.

{
    "key": "shift+alt+f",
    "command": "macros.fixDocumentAndSort",
    "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
}
Enter fullscreen mode Exit fullscreen mode
"macros": {
    "eslintFixAndFormatDocument": [
        "eslint.executeAutofix",
        "editor.action.formatDocument"
    ],
},
Enter fullscreen mode Exit fullscreen mode

In this binding, vscode is performing two actions

  • formatting the document
  • fixing eslint issues.

Top comments (0)