1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[VSCode] Github Copilotの提案受け入れをtabキーから変更する

Posted at

概要

VSCodeでGithub Copilotを導入したところ、元々のコード補完のキーバインドがCopilotの提案受け入れのキーバインドと競合してしまった。

やりたいこと

下図の場合
250225_0.png
現状ではtabキーを押すとCopilotの提案「document.querySelector('h1').textContent;」が入力される。

これを
 tabキー → VSCodeのコード補完
 他のショートカット → Copilotの提案受け入れ
というように選べるようにしたい。

※Copilot提案を一単語ずつ受け入れ(ctrl + →)で「document」だけの入力もできるが、コード補完を今まで通り気兼ねなくガンガン使いたいので今回はCopilotからtabキーを取り戻す方向でいく。

普通に設定変更してみる

VSCodeのキーバインド設定を開き(ctrl+K ctrl+S)
検索窓に「copilot」と入力してみると...

250225_1.png

tabキーをバインドしている項目が一つも無い。

解決方法

Copilot提案受け入れの正しい項目名は
  - Accept Inline Suggestion
 (keybind.json上では "editor.action.inlineSuggest.commit"
らしいので、それを任意のキーに変更すれば完了。

参考 Tab completion conflicts [GitHub Copilot] #7036

まとめ

まさかの"copilot"というワードを含まない、エディタ自体の設定という扱いだった。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?