VSpaceCode / VSpaceCode

Spacemacs like keybindings for Visual Studio Code

Home Page:https://vspacecode.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Copilot Bindings

david-morris opened this issue · comments

Problem

Copilot, and LLMs in general, are useful tools gaining in popularity and effectiveness.

I've started using Copilot Chat and I'm noticing that my workflow is inelegant around using it. I think that's something we should adapt to sooner rather than later, because LLMs are probably only going to get better and become a bigger part of developer workflows.

I can use the quick actions menu items, but they don't let me go back and forth with the AI, I find the suggestions harder to read, and a menu action like SPC e f C-n C-n (with an unknown number of C-ns) isn't ideal.

Solution

spc a for AI menu, with items for all the quick suggestions as well as an item for focusing the AI window

Alternatives

Potentially these items could be chucked into the errors menu like the quick actions menu, but I think that's confusing.

Is there any way of dispatching and populating bindings in a modular way?

Additional context

I can figure out how to write a sub menu, but I want to hear from others to see what kinds of bindings would work for the most people.

I don't think there are lots of close competitors to Copilot, but there's a lot of different extensions with different features. How can we avoid stepping on those user's toes?

I found similar issues when trying to get co-pilot into my vspacecode-centric use of VSCode. I came up with a cursory set of keybindings (not fully tested). I'll udpate if I make any meaningful changes.

{
  "vspacecode.bindingOverrides": [
      "keys": "c",
      "name": "Co-Pilot",
      "type": "bindings",
      "bindings": [
        {
          "key": "c",
          "name": "Open New Chat",
          "command": "workbench.action.openChat.copilot"
        },
        {
          "key": "i",
          "name": "Interactive",
          "type": "bindings",
          "bindings": [
            {
              "key": "e",
              "name": "Explain",
              "command": "github.copilot.interactiveEditor.explain"
            },
            {
              "key": "f",
              "name": "Fix",
              "command": "github.copilot.interactiveEditor.fix"
            },
            {
              "key": "t",
              "name": "Generate Test",
              "command": "github.copilot.interactiveEditor.generateTests"
            },
            {
              "key": "d",
              "name": "Generate Docs",
              "command": "github.copilot.interactiveEditor.generateDocs"
            }
          ]
        },
        {
          "key": "q",
          "name": "Open New Quick Chat",
          "command": "workbench.action.openQuickChat.copilot"
        }
      ]
}

My biggest problem now is easily getting in & out of my co-pilot chat window without reaching for a mouse A lot of these co-pilot flows involv selecting large pieces of text for LLM context, so I'm constantly needing to bounce my active text window between code & chat. I'll likely continue to tweak this until there is better out-of-the-box support, but I hope this is at least helpful.

Here is a few icons added to what's been posted above:

{
  "vspacecode.bindingOverrides": [
      "keys": "c",
      "name": "Co-Pilot",
      "type": "bindings",
      "icon": "copilot",
      "bindings": [
        {
          "key": "c",
          "name": "Open New Chat",
          "icon": "comment",
          "command": "workbench.action.openChat.copilot"
        },
        {
          "key": "i",
          "name": "Interactive",
          "icon": "comment-discussion",
          "type": "bindings",
          "bindings": [
            {
              "key": "e",
              "name": "Explain",
              "icon": "question",
              "command": "github.copilot.interactiveEditor.explain"
            },
            {
              "key": "f",
              "name": "Fix",
              "icon": "check",
              "command": "github.copilot.interactiveEditor.fix"
            },
            {
              "key": "t",
              "name": "Generate Test",
              "icon": "beaker",
              "command": "github.copilot.interactiveEditor.generateTests"
            },
            {
              "key": "d",
              "name": "Generate Docs",
              "icon": "book",
              "command": "github.copilot.interactiveEditor.generateDocs"
            }
          ]
        },
        {
          "key": "q",
          "name": "Open New Quick Chat",
          "icon": "comment-draft",
          "command": "workbench.action.openQuickChat.copilot"
        }
      ]
}