Skip to content

Allow key bindings to use arguments for commands #58

Open

Description

@rioj7

The toggle commands do not use the arguments set in a key binding.

  {
    "key": "ctrl+i t",
    "command": "settings-toggle.toggle-workspace",
    "args": {
      "action": "set",
      "setting": "workbench.colorTheme",
      "value": "Default Light+"
    }
  }

Possible values for action:

  • toggle : toggle the current value
  • set : set the settings to the value given in property value (string, boolean, number, array, object)
  • reset or default : revert to default value
  • ....... : something I didn't think of

Activity

  1. added
    enhancement
    on Oct 3, 2021
  2. z0al commented on Oct 3, 2021

    @z0al
    Owner

    Great suggestion @rioj7 . I was not aware it's possible to pass args to commands when defining keybindings.

    This shouldn't be hard to implement but I'm quite busy these days so won't be able to tackle it soon. If you want to open a PR by all means go ahead, I'd appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions