gpt4 book ai didi

terminal - VSCode : how to make Ctrl+k kill till the end of line in the terminal?

转载 作者:行者123 更新时间:2023-12-02 21:59:20 25 4
gpt4 key购买 nike

在 Visual Studio Code 中,Ctrl-k 快捷键绑定(bind)到 clearing the terminal .

我已经configured bash as my terminal在 Windows 中,并希望它的行为与传统的 Emacs 键绑定(bind)一样,即使其终止行尾。

我尝试在用户设置中禁用此配置的默认键绑定(bind),但它不起作用:

"commandsToSkipShell": [
"workbench.action.terminal.clear"
]

如何让终端服从我20年训练的肌肉内存?

最佳答案

如果您对 Unix shell 有多年的肌肉内存,并且希望防止 VSCode 捕获您的键盘快捷键,请关闭 allowedChords。在较新的 VSCode 版本中,您只需打开文件 -> 首选项 -> 用户(选项卡),搜索 allowChords 并取消选中它。

或者您可以编辑 %APPDATA%\Code\User\settings.json 文件并输入以下内容:

   "terminal.integrated.allowChords": false

现在很多终端快捷方式都可以使用:

  • Ctrl+K 杀死直到行尾,
  • Ctrl-Y 从上面粘贴被删除的行
  • Ctrl+R 在历史记录中搜索您的命令,
  • 然后 Ctrl+A 转到行首

我在这个帖子中有另一个答案,但我认为这是一个更好的解决方案。这是documentation .

如果您只想修复 Ctrl-K 行为,请参阅其他答案。

关于terminal - VSCode : how to make Ctrl+k kill till the end of line in the terminal?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50569100/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com