In VSCode, the Command-K shortcut (Ctrl-K on PC) is used as the first half of a bunch of chorded keyboard shortcuts. For example, the shortcut to close all editors is to press Command-K and then Command-W. But in Cursor, Command-K is used to issue a code instruction to the AI.
How do I access the various keyboard shortcuts bound to Command-K?
Thanks for reporting this. What would your desired solution be here? We switch the default AI editing binding from Command K to something else? Or we switch the chorded keybinding?
I think right now we’re planning on trying out switching the chorded to keybinding to Command R if people like that.
I have a fair bit of muscle memory around Command-K combos. I think I would prefer changing the AI’s default binding.
I updated mind to use cmd+option+L and cmd+option+K, to avoid existing shortcuts. Would probably make a good default.
The bigger problems I encountered were:
- These new keyboard shortcuts were wiped out (i.e. reset to Cursor’s default) after updating Cursor yesterday.
- The keyboard shortcuts were hard to set, for me, just trying to get option+cmd+L to toggle the sidebar open & close. I finally figured out that
workbench.panel.aichat.view.toggleVisibility doesn’t seem to work for this and that
aichat.close-sidebar only works if the text input within the chat is not focused. Since it focuses automatically when opening the sidebar, it’s impossible to set up a shortcut that simply toggles the chat open > close > open > close > etc).
- There is room for improvement in consistent naming–Cursor’s current commands are a mix of kebab case (
aichat.close-sidebar), all one word (
aichat.opensidebar), or camelCase (
aichat.switchToMostRecentChat), etc meaning when this is fixed, I’ll probably end up losing my shortcuts again anyway.
CC @truell20 as fyi
I just spent 30 minutes trying to set new shortcuts instead of cmk+k and I am failing to do so. As with most people, I have a motor drive to clear my terminal quite often and every time I hit cmd+k without thinking, ai popup comes up, this is driving me crazy. I have set/changed the shortcuts multiple times, restarted cursor multiple times, its not taking effect, going back to vs code, sorry.
Of course I had to post the previous reply before I figure it out.
These two were the source of confusion for me…
“aipopup.action.modal.generate” vs “cursorai.action.generateInTerminal”
Not going back to vscode, yet.