1
1

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】copilot のコード補完をトグルで切替可能にしたい

1
Last updated at Posted at 2026-04-26

はじめに

コーディングしているときの私の最近の悩みが発端です

コードを書く際に私のコード生成の為の思考速度より copilot のコード生成の速度の方が遥かに速い為、自分でまとまったコードを書く機会がないことに危機感がありました

そこで、toggle で vscode 上に補完されるコードを表示・非表示を切り替えられるようにしてコーディングに向き合う環境を作ることが目的です

方法

  1. VSCode の拡張機能 Settings Cycle をインストールする
    https://marketplace.visualstudio.com/items?itemName=hoovercj.vscode-settings-cycler

  2. settings.json を開き、以下の設定を追記する
    (Command + Shift + P でコマンドパレットを開き、「>open settings.json」と入力)

    settings.json
    "settings.cycle": [
       {
        "id": "toggleCopilotCompletion",
         "overrideWorkspaceSettings": true,
         "values": [
           {
             "github.copilot.enable": {
               "*": true
             }
           },
           {
             "github.copilot.enable": {
               "*": false
             }
           }
         ]
       }
    ]
    
  3. keybindings.json を開き、以下の設定を同様に追加する

    keybindings.json
    {
      "key": "cmd+shift+z",
      "command": "settings.cycle.toggleCopilotCompletion",
    }
    
    

これで切り替えができるようになりました!
もしうまくいかなければ以下を参考にしてみてください

所感

面倒くさがりでキーバインドの設定をこれまで一切したことがなかったのですが、初めの導入さえ分かれば非常に便利な機能だと感じています

面倒くさがりだからこそ時短できるように色々な工夫をしていきたいなと思います
(急がば回れ)

ここまで読んでいただきありがとうございました。参考になれば幸いです!

1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?