ryuta46 / vscode-multi-command

Visual Studio Code Plugin named multi-command
MIT License
229 stars 14 forks source link

Feature Request: Support specifying commands in keybindings.json #31

Closed leighmcculloch closed 3 years ago

leighmcculloch commented 3 years ago

Support specifying commands in keybindings.json so as to keep all information together rather than split across json files, for simple usages.

Example: keybindings.json

{ 
    "key": "F1", 
    "command": "extension.multiCommand.execute" , 
    "args": { "commands": ["cursorDown", "cursorDown", "cursorDown"] },
    "when": "editorTextFocus"
}

That ☝🏻 is instead of: keybindings.json

{ 
    "key": "F1", 
    "command": "extension.multiCommand.execute" , 
    "args": { "command": "multiCommand.down3Lines" },
    "when": "editorTextFocus"
}

settings.json

"multiCommand.commands": [
    {
        "command": "multiCommand.down3Lines",
        "sequence": [
            "cursorDown",
            "cursorDown",
            "cursorDown"
        ]
    }
]
ryuta46 commented 3 years ago

Very simple and useful feature. I'll try to implement this feature in next version.

ryuta46 commented 3 years ago

Implemented in 1.5.0. Please reopen this issue or create new issue if you have any problem about this feature. Thanks.

leighmcculloch commented 3 years ago

Thank you @ryuta46!

leighmcculloch commented 3 years ago

Just tested it, and it works great!