如何在 VS Code 终端中突出显示用于复制和粘贴的文本? [英] How do I highlight text for copying and pasting in the VS Code terminal?

查看:47
本文介绍了如何在 VS Code 终端中突出显示用于复制和粘贴的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建快捷方式来突出显示终端文本:Ctrl+Shift+Right/Left、Ctrl+Shift+End、Ctrl+Shift+Home - 正如在 PowerShell ISE 中实现的那样?

How do I create shortcuts to highlight Terminal text: Ctrl+Shift+Right/Left, Ctrl+Shift+End, Ctrl+Shift+Home - as it's implemented in PowerShell ISE?

如何创建快捷方式来按单词移动光标:Ctrl+Right/Left,类似于 PowerShell ISE?

How do I create shortcuts to move cursor by words: Ctrl+Right/Left, similar to PowerShell ISE?

推荐答案

我正在为愿意安装 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:

这篇关于如何在 VS Code 终端中突出显示用于复制和粘贴的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆