VSCode에서 vim과 copilot 키 충돌
vim에서 esc는 Insert모드에서 빠져나갈때 사용하지만, copilot의 코드 자동완성을 취소할 때 쓰는 것과 꼬이는 경우가 많다.
해결하는 방법 중 하나는 자동완성 시 먼저 copilot에게 키 입력을 보내게 하고, 자동완성 제안이 없는 경우는 vim으로 입력을 넘겨주는 것이다.
방법
ctrl + shift + p로 Command Pallete를 열고Preferences: Open Keyboard Shortcuts (JSON)입력배열에 아래 내용을 추가
1
2
3
4
5
6
7
8
9
10
{
"key": "escape",
"command": "editor.action.inlineSuggest.hide",
"when": "inlineSuggestionVisible && editorTextFocus"
},
{
"key": "escape",
"command": "extension.vim_escape",
"when": "editorTextFocus && vim.active && !inlineSuggestionVisible"
},