VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.98k stars 1.32k forks source link

`ctrl+i` or `command+i` for Copilot Chat #8418

Open vinliao opened 1 year ago

vinliao commented 1 year ago

Is your feature request related to a problem? Please describe. EDIT: QUICK HACK (put this in your settings.json):

  "vim.visualModeKeyBindingsNonRecursive": [
    {
      "before": ["<C-i>"],
      "commands": ["interactiveEditor.start"]
    }
  ],
  "vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": ["<C-i>"],
      "commands": ["interactiveEditor.start"]
    }
  ],

The default key to open Copilot Chat window (in-editor) is ctrl+i, when the extension is active, it doesn't work.

image

Describe the solution you'd like ctrl+i on normal or visual mode to open the same panel.

Describe alternatives you've considered Quick hack would be mapping ctrl+i on settings.json, unsure what the "open chat panel" command is exactly.

Additional context Add any other context or screenshots about the feature request here.

PabloLION commented 1 year ago

I guess I could comment that on mac my cmd+i is working correctly, so this is for windows only.

rodrigomlpOz commented 1 year ago

Having the same issue on Windows

arrrmin commented 1 year ago

I got same issue on Windows too.

blanham commented 1 year ago

Can we get a real fix for this please?

dekarpaulvictor commented 1 year ago

I have the same issue on Linux too. I run Arch Linux with KDE Plasma as the Desktop Environment. Took me a while to figure out that it wasn't an issue related to my current windowing system and pre-configured keyboard shortcuts but the Vim plugin installed in VS Code. Disabling that fixes the issue. But I need Vim emulation active at the same time...so, yeah, if there is a way to have both the Vim plugin active and CTRL+I working so I can use Copilot Chat in-editor then that would be great.

paulhybryant commented 7 months ago

Seems the PR is not merged.

Any way to workaround it for now?

AndrewIzatt commented 6 months ago

Any estimate on when this fix going to be merged into the extension? I love Vim. I love VSCode. I love Github Copilot. I want to love them all together!

pilgrimlyieu commented 6 months ago

According to #8767, here's a quick fix.

Use Ctrl + K Ctrl + S to open keyboard shortcuts setting. Them search "Ctrl+i", and there's a command called extension.vim_ctrl+i, whose source is Vim. Them add && vim.mode == 'Normal' to its When expression. That's, turning it into editorTextFocus && vim.active && vim.use<C-i> && !inDebugRepl && vim.mode == 'Normal'.

Now Copilot Inline Chat works in my circumstance.

AndrewIzatt commented 6 months ago

According to #8767, here's a quick fix.

Use Ctrl + K Ctrl + S to open keyboard shortcuts setting. Them search "Ctrl+i", and there's a command called extension.vim_ctrl+i, whose source is Vim. Them add && vim.mode == 'Normal' to its When expression. That's, turning it into editorTextFocus && vim.active && vim.use<C-i> && !inDebugRepl && vim.mode == 'Normal'.

Now Copilot Inline Chat works in my circumstance.

Thank you so much for your quick reply. I edited the "When" expression as you indicated. But this still isn't allowing me to enter Github Copilot chat. It does however enter "Insert" mode (which maybe is what you were trying to solve) but my issue is I'd like to be able to use Ctrl+i to use my Github Copilot chat feature. Any more help would be greatly appreciated.

pilgrimlyieu commented 6 months ago

It does however enter "Insert" mode (which maybe is what you were trying to solve) but my issue is I'd like to be able to use Ctrl+i to use my Github Copilot chat feature. Any more help would be greatly appreciated.

Do you mean you want use Chat feature even in Normal mode? The Copilot Chat works when I'm in Insert mode or Visual mode because I still want to use Ctrl + I to move my cursor in Normal mode. If the key is useless for you, maybe you could disable or delete the binding. Hopefully I haven't misunderstood you.

{
    "key": "ctrl+i",
    "command": "-extension.vim_ctrl+i",
    "when": "..."
}
wheezy1749 commented 2 months ago

Just wanted to say thanks for your EDIT:

This should probably be handled by this extension by default in some way. Vim is super common for people to use. Anyway, thanks mate!

eric-burel commented 2 weeks ago

Going to ask the dumb question, but how do we change GitHub Copilot shortcut instead? I don't like changing Vim shortcuts much, as this prevents actually learning Vim. Ctrl+I seems to be for moving to the latest change in normal mode and could be a cool shortcut to use. For AI completion, using ctrl+shift+k in cursor felt great but I can't find the right Copilot shortcut in the settings