nev*_*ves 29 terminal keyboard-shortcuts visual-studio-code vscode-settings
在 Visual Studio Code 中,Ctrl-k 快捷键绑定到清除终端。
我已经在 Windows 中将bash 配置为我的终端,并希望它像传统的 Emacs 键绑定一样工作,也就是说,让它终止行尾。
我尝试在用户设置中禁用此配置的默认键绑定,但它不起作用:
"commandsToSkipShell": [
"workbench.action.terminal.clear"
]
Run Code Online (Sandbox Code Playgroud)
如何让终端服从我20年训练的肌肉记忆?
nev*_*ves 33
如果您对 Unix shell 有多年的记忆,并想阻止 VSCode 捕获您的键盘快捷键,请关闭 allowChords。在较新的 VSCode 版本中,您只需打开File -> Preferences -> User (tab),搜索 allowChords 并取消选中它。
或者您可以编辑您的%APPDATA%\Code\User\settings.json文件并输入:
"terminal.integrated.allowChords": false
Run Code Online (Sandbox Code Playgroud)
现在很多命令都可以工作:
我在这个线程中有另一个答案,但我认为这是一个更好的解决方案。这是文档。
如果您只想修复 Ctrl-K 行为,请参阅其他答案。
Jak*_*sky 23
遇到了同样的问题。将此代码段添加到 keybindings.json 工作:
{
"key": "ctrl+k",
"command": "deleteAllRight",
"when": "terminalFocus"
}
Run Code Online (Sandbox Code Playgroud)
刚刚发现!您需要在配置前加上减号。编辑%APPDATA%\Code\User\settings.json并输入该密钥:
"terminal.integrated.commandsToSkipShell": [
"-workbench.action.terminal.clear"
]
Run Code Online (Sandbox Code Playgroud)
看起来配置选项已重命名,所以我编辑了现在对我有用的内容(2018 年 11 月)。
| 归档时间: |
|
| 查看次数: |
5060 次 |
| 最近记录: |