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

标签 terminal keyboard-shortcuts visual-studio-code

在 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/

相关文章:

macos - 如何在Vim中存储Golang模板宏

emacs - 多个 emacs 终端

python - 想在 python 中调整终端窗口的大小,工作但不太正确

eclipse - 当我在 Eclipse 的 java 编辑器中输入 "Ctrl + Shift + T"时,它显示 <ul></ul>

visual-studio-code - 如何重新格式化 VS 代码项目中的所有文件?

java - 如何使用Android studio将2个项目合并为1个?

c# - Ctrl+K、Ctrl+C 是不再适用于 Visual Studio 2010 的命令

keyboard-shortcuts - 如何在 Mac 中为 Sublime Text 移动队列?

visual-studio-code - 如何让vscode自动使用cmake include路径

visual-studio - 忽略 VS Code 中的文件或文件夹