Skip to content

How to set any entry in settings.json with Dance (dance.run?) #270

Answered by 71
bfulop asked this question in Q&A
Discussion options

You must be logged in to vote

You can change the configuration with dance.run using WorkspaceConfigurations in VS Code.

An example where tab is used to toggle inlay hints:

// keybindings.json
[
  // ...
  {
    "key": "tab",
    "command": "dance.run",
    "args": {
      "code": [
        "const cfg = vscode.workspace.getConfiguration('editor.inlayHints');",
        "cfg.update('enabled', !cfg.get('enabled', false));"
      ],
    },
    "when": "editorTextFocus && dance.mode == 'normal'",
  },
]

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bfulop
Comment options

Answer selected by bfulop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants