1

我经常复制和粘贴不同的预定义文本集,所以最好有一个程序级的键绑定来设置它。在 .json 文件键绑定部分,我尝试了以下操作:

{
  "command": {
    "command": "paste",
    "insert": "<custom txt",
    "keys": "ctrl+s"
  }
  
}

或者

{
      "command": {
        "command": "paste",
        "commandline": "custom txt",
      }
      "keys": "ctrl+s"
    }

.

在可用的Windows 终端键绑定文档中似乎没有为此设置任何操作。

4

1 回答 1

0

发送输入向 shell 发送任意文本输入。

keybindings在(or actions) 数组中添加以下项:

// Press Ctrl+S to send text (defined by the "input" field) to the shell.
// This command is not currently bound in the default settings.
{ "command": { "action": "sendInput", "input": "some custom text" }, "keys": "ctrl+s" }

ⓘ 重要

从 Windows 终端版本 1.4 开始,该keybindings数组已重命名为actions位于settings.json文件中。仍然存在对数组的支持以 keybindings实现向后兼容性,但是终端不会自动重命名keybindingsactions 您的settings.json文件中的名称。

于 2020-11-15T20:23:53.833 回答