且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 VS Code 终端中突出显示用于复制和粘贴的文本?

更新时间:2022-12-22 10:44:25

我正在为愿意安装 zsh 的用户添加一个单独的答案.

I'm adding a separate answer for users willing to install zsh.

这是一个不做任何假设的部分解决方案:

This is a partial solution that makes no assumptions:

    {
        "key": "ctrl+left",
        "command": "workbench.action.terminal.sendSequence",
        "args": { "text": "\u001bb" },
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+right",
        "command": "workbench.action.terminal.sendSequence",
        "args": { "text": "\u001bf" },
        "when": "terminalFocus"
    }

它将为您提供 Windows 风格的 Ctrl-Left/Right 导航.

It will give you Windows-style Ctrl-Left/Right navigation.

这在您的 keybindings.json 中.我的位于 ~\AppData\Roaming\Code\User\keybindings.json~\AppData\Roaming\Code - Insiders\User\keybindings.json.(我在桌面上运行 Windows,但在 Linux 上进行远程开发.)

This goes in your keybindings.json. Mine are at ~\AppData\Roaming\Code\User\keybindings.json and ~\AppData\Roaming\Code - Insiders\User\keybindings.json. (I run Windows on the desktop but do remote dev on Linux.)

如果我设法进一步了解这个,我会更新.但这并不容易,因为:

I'll update if I manage to get any further with this. But it's not easy, because: