Switching Focus from AI Chat Panel to Editor

I’m trying to set up a keybinding (Ctrl+h) to switch focus from the AI chat panel back to the editor. Currently, keybindings don’t seem to work while in the chat panel.

Any guidance on making this work would be helpful. Thanks!

Hi @kenryu

You can toggle focus between the chat and code area using the Ctrl + 1 shortcut.

Pressing ESC also removes the focus from the chat for me.

Hi, if I’m using the vim extension, I can’t toggle focus back to the chat area from the code area. How can this be done while having this extension active?

Hey, this is a common issue. The Vim extension grabs keybindings before they reach Cursor.

Add this to settings.json via Ctrl+Shift+P or Cmd+Shift+P, then run Preferences: Open User Settings (JSON):

"vim.handleKeys": {
    "<C-l>": false
}

This makes Vim pass through Ctrl+L, so Cursor can handle it and open or focus the chat.

If that doesn’t work for some reason, you can set an explicit binding in keybindings.json via Ctrl+Shift+P or Cmd+Shift+P, then run Preferences: Open Keyboard Shortcuts (JSON):

{
    "key": "ctrl+l",
    "command": "aichat.newchataction",
    "when": "editorTextFocus && !terminalFocus"
}

Let me know if it helped.

fixed it, thank you!

on Mac, Cmd + 1doesn’t switch focus from agent chat to editor. This is working in Vscode but not in cursor.