vincent15000's avatar

VSCode shortcuts

Hello,

For some months, I have Ctrl + Alt + i to import namespaces and classes.

From today, I don't know why, the AI Agent panel opens with Ctrl + Alt + i instead of importing the classes.

How can I change this ?

I already changed the shortcuts view from the File > Preferences menu, but it doesn't work.

Do you have any other advice to deactivate the shortcut for the Agent AI panel ?

Thanks for your help.

V

0 likes
2 replies
LaryAI's avatar
Level 58

Certainly! Here’s how you can resolve the shortcut conflict in VSCode:

1. Open Keyboard Shortcuts

  • Press Ctrl + K then Ctrl + S (or go to File > Preferences > Keyboard Shortcuts).

2. Search for the Shortcut

  • In the search bar at the top, type:
    ctrl+alt+i
    
  • This will list all commands bound to Ctrl + Alt + I.

3. Identify and Remove/Change the AI Agent Shortcut

  • Find the entry associated with the AI Agent panel, likely something like AI Agent: Open Panel.
  • Right-click that entry, and select Remove Keybinding or assign a different shortcut if you prefer.

4. Ensure Your Import Shortcut is Set

  • Still in Keyboard Shortcuts, search for your import namespace/class extension (e.g., "Import Magic", "PHP Namespace Resolver", or similar, depending on your workflow).
  • Assign or confirm Ctrl + Alt + I is set for the import action:
    1. Click the pencil icon next to the relevant command.
    2. Set it to Ctrl + Alt + I.

5. Check Extensions

  • If the conflict persists, some extensions might override shortcuts. Go to the settings of the AI Agent extension and look for shortcut settings, or consider disabling/reconfiguring shortcut keys there.

Optional: Edit keybindings.json Directly

  1. From the Keyboard Shortcuts UI, click the {} icon at the top right to open keybindings.json.
  2. Manually remove or adjust entries related to ctrl+alt+i, for example:
    [
        // ... other bindings
        {
            "key": "ctrl+alt+i",
            "command": "-aiAgent.openPanel" // the minus disables the shortcut
        },
        {
            "key": "ctrl+alt+i",
            "command": "your.import.command"
        }
    ]
    

Restart VSCode to ensure all changes take effect.


Summary:

  • Remove or reassign the shortcut from the AI Agent panel.
  • Set the desired import shortcut back to Ctrl + Alt + I.
  • Use the Keyboard Shortcuts interface or directly edit keybindings.json.

Let me know if you need more detailed steps for a particular extension!

quintinmorrow's avatar
Level 1

Honestly, this feels like one of those VS Code moments where an update quietly hijacks a shortcut. Checking keybindings.json directly usually solves it faster than the UI, especially when extensions get involved. Disabling the AI panel binding with a minus entry worked for me before. After a restart, the import shortcut should behave normally again.

1 like

Please or to participate in this conversation.