visual-studio-code - 在 VS Code 中禁用 "undo command for file operations in Explorer"功能

标签 visual-studio-code

在最近版本的 VSCode 中,真正让我感到困扰的是此功能可在文件资源管理器中撤消文件操作。显然,这是自 v1.52(2020 年 11 月)以来的新功能 https://code.visualstudio.com/updates/v1_52 .
这有时会导致我之前创建的文件消失,因为我不小心在文件资源管理器而不是文件编辑器中按了 cmd+z。我不想要这个,因为它严重扰乱了我的工作流程,而且删除我不想删除的文件通常很烦人。所以我想禁用它,但在设置中找不到禁用此功能的位置。你知道在哪里/如果我能做到这一点吗?

最佳答案

我没有看到相关设置,但您可以这样做,以便 undo仅当您拥有 editorFocus 时才有效(在您的 keybindings.json 中):

{
  "key": "ctrl+z",
  "command": "undo",
  "when": "editorFocus"
},
{
  "key": "ctrl+z",
  "command": "-undo"
}

您可能知道,v1.53 至少为 undo 添加了一个确认对话框。资源管理器中的操作,参见 v1.53 release notes confirmation dialogs .

If a user tries to quit VS Code while there is a file operation in progress, we now show a confirmation dialog. We also show a confirmation dialog for destructive undo operations from the Explorer.


它不是阻止甚至尝试这样做的设置,但确实提供了一些保护。

关于visual-studio-code - 在 VS Code 中禁用 "undo command for file operations in Explorer"功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65966902/

相关文章:

python - VSCode 无法从虚拟环境中正确运行 pytest

key-bindings - 命令选择器的 VSCode 导航键绑定(bind)

shell - VSCode SSH Remote 连接到 EC2 实例, "shell integration failed to activate"用于基于 zsh 的终端

在 Visual Studio Code 中调试 Strapi

visual-studio-code - Visual Studio Code : How to have both Debug window and Explorer window open together?

python - 如何判断 VS Code 使用的 Python 格式化程序的版本?

node.js - 无法启动 VS Code,出现未捕获的异常

VSCode 中的 Flutter 初始化

visual-studio-code - vscode phpcs : referenced sniff Universal. WhiteSpace.DisallowInlineTabs 不存在

c# - 在 VS Code 中重命名重构