1
0
お題は不問!Qiita Engineer Festa 2024で記事投稿!
Qiita Engineer Festa20242024年7月17日まで開催中!

[VSCode]Github Copilotで1単語ずつ承認したいけど、ショートカットが効かない時

Posted at

はじめに

Github Copilotのサジェストを1単語ずつ承認するショートカットがうまく動かなかったので、調べてなんとかしました

ショートカット

MacOSのデフォルトでは cmd + → です。
https://docs.github.com/ja/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot#accepting-partial-suggestions

他のショートカットと競合したのか動きませんでした。

ショートカットのoverride

まず、Preferrences -> Keyboard Shortcutsを選択してください。

そうしたら右上にこんな感じのマークがありますので、
image.png

赤く囲われたアイコンをクリックしてください。

そうしたら、keybindings.jsonっていうファイルが開くので、以下のようにしてください。

[
  {
    "key": "cmd+right", // 任意のコマンド追加
    "command": "editor.action.inlineSuggest.acceptNextWord",
    "when": "inlineSuggestionVisible && !editorReadonly"
  }
]

以上です。

まとめ

便利になりました。

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