使用 Vim 扩展时如何在 Esc 上自动保存 VSCode 中的文件?

She*_*rsh 3 autosave visual-studio-code vscodevim

我想知道,在 Vim 中按 键退出插入模式后,如何在 VSCode 中自动保存当前文件Esc

hor*_* he 7

替换<Esc><Esc>:w<Enter>有效,但这可能是一个稍微更优雅的解决方案(例如,如果您有其他想要运行的保存命令)。

    "vim.insertModeKeyBindingsNonRecursive": [
    {
        "before": [
            "<Esc>"
        ],
        "after": [
            "<Esc>"
        ],
        "commands": [
            "workbench.action.files.save"
        ]
    }
],
Run Code Online (Sandbox Code Playgroud)