vscodevimがCopilot Next Edit Suggestions(NES)のキー入力を邪魔する

GitHub CopilotのNext Edit Suggestionsは次の編集を提案する機能。

2025年2月現在はpreview段階で以下をsettings.jsonに追加すると有効になる。

{
    "github.copilot.nextEditSuggestions.enabled": true,
}

提案はTabキーで採用、Escキーで拒否する。

vscodevimを有効にしている場合はinsertモードのときにTabキーで採用できるが、Escキーはnormalモードへ戻るために使われているためCopilot Next Edit Suggestionsの提案を拒否できない。

vscodevimのnormalモードでTab、EscキーでCopilot Next Edit Suggestionsの提案を操作する

ネットで調べるとissueが上がっており、キーバインディングの設定による方法が紹介されている。
» Enable not handling for <tab> and <esc> in normal mode · Issue #9459 · VSCodeVim/Vim

以下の設定で提案時はvscodevimでもTab、Escキーで採用、拒否できるようになる。 (コメントからそのまま抜粋 )

[
    {
        "key": "escape",
        "command": "-extension.vim_escape",
        "when": "editorTextFocus && vim.active && !inDebugRepl"
    },
    {
        "key": "escape",
        "command": "extension.vim_escape",
        "when": "editorTextFocus && vim.active && !inDebugRepl && !testing.isPeekVisible && !testing.isInPeek && (vim.mode == 'Insert' || !notebookEditorFocused) && !inlineEditIsVisible && !suggestWidgetVisible && !findWidgetVisible && !dirtyDiffVisible"
    },
    {
        "key": "escape",
        "command": "runCommands",
        "when": "vim.mode == 'Insert' && inlineEditIsVisible",
        "args": {
            "commands": [
                "editor.action.inlineSuggest.hide",
                "extension.vim_escape"
            ]
        }
    },
    {
        "key": "escape",
        "command": "runCommands",
        "when": "vim.mode == 'Insert' && suggestWidgetVisible",
        "args": {
            "commands": [
                "hideSuggestWidget",
                "extension.vim_escape"
            ]
        }
    },
    {
        "key": "escape",
        "command": "-hideSuggestWidget",
        "when": "suggestWidgetVisible && textInputFocus"
    },
    {
        "key": "escape",
        "command": "hideSuggestWidget",
        "when": "suggestWidgetVisible && textInputFocus && !vim.active"
    },
    {
        // Remove VSCodeVim's handling of tab to enable default handling of tab
        // e.g. for inline suggestions.
        "key": "tab",
        "command": "-extension.vim_tab",
    },
]