How do I change the keyboard shortcuts that Cursor uses?
We hope to build better UI for this in the future. For now,
- Type Command/Ctrl + Shift + P.
- Go to âpreferences: open keyboard shortcutsâ
- Edit the
aipopup.action.modal.generate
action to remap the inline edits / generation keybinding - Edit the
aichat.newchataction
action to remap the new chat command
For future passersby, to fully remove Cursorâs cmd+K mappings, you also need to update cursorai.action.generateInTerminal
Hi! How can I change ai chat send message key? Itâs âEnterâ now, but I want it to be âShift+Enterâ and use âEnterâ to insert a new line.
Is there any way to directly access the data / json that vscode / cursor use for the key mappings instead of having to do this manually? It would also make it easy to put things back if it gets messed up.
Itâs utter madness that such an important keymapping was overwritten.
+1. I am wasting so many chat requests by mistakenly hitting Enter to create a new lineâŚ
You can edit default keybindings.json -
You can also specify overrides for yourself -
VS doesnât have a chat window. How can we change the keyboard shortcut to submit a message in Cursorâs chat window?
C:\Users\<yourUser>\AppData\Roaming\Cursor\User\keybindings.json
// Place your key bindings in this file to override the defaults
[
{
âkeyâ: âctrl+shift+kâ,
âcommandâ: âeditor.action.deleteLinesâ,
âwhenâ: âtextInputFocus && !editorReadonlyâ
},
{
âkeyâ: âctrl+k ctrl+câ,
âcommandâ: âeditor.action.addCommentLineâ,
âwhenâ: âeditorTextFocus && !editorReadonlyâ
},
{
âkeyâ: âctrl+k ctrl+uâ,
âcommandâ: âeditor.action.removeCommentLineâ,
âwhenâ: âeditorTextFocus && !editorReadonlyâ
},
{
âkeyâ: âctrl+k ctrl+/â,
âcommandâ: âeditor.foldAllBlockCommentsâ,
âwhenâ: âeditorTextFocus && foldingEnabledâ
},
{
âkeyâ: âctrl+k ctrl+0â,
âcommandâ: âeditor.foldAllâ,
âwhenâ: âeditorTextFocus && foldingEnabledâ
},
{
âkeyâ: âctrl+k ctrl+jâ,
âcommandâ: âeditor.unfoldAllâ,
âwhenâ: âeditorTextFocus && foldingEnabledâ
},
{
âkeyâ: âctrl+k ctrl+kâ,
âcommandâ: âeditor.action.defineKeybindingâ,
âwhenâ: âeditorTextFocusâ
},
{
âkeyâ: âctrl+k mâ,
âcommandâ: âworkbench.action.editor.changeLanguageModeâ,
âwhenâ: â!notebookEditorFocusedâ
},
{
âkeyâ: âctrl+k pâ,
âcommandâ: âworkbench.action.files.copyPathOfActiveFileâ
},
{
âkeyâ: âctrl+k râ,
âcommandâ: âworkbench.action.files.revealActiveFileInWindowsâ
},
{
âkeyâ: âctrl+k oâ,
âcommandâ: âworkbench.action.files.showOpenedFileInNewWindowâ,
âwhenâ: âemptyWorkspaceSupportâ
},
{
âkeyâ: âctrl+k sâ,
âcommandâ: âworkbench.action.files.saveAllâ
},
{
âkeyâ: âctrl+k ctrl+wâ,
âcommandâ: âworkbench.action.closeAllEditorsâ
},
{
âkeyâ: âctrl+k wâ,
âcommandâ: âworkbench.action.closeEditorsInGroupâ
},
{
âkeyâ: âctrl+k fâ,
âcommandâ: âworkbench.action.closeFolderâ,
âwhenâ: âemptyWorkspaceSupport && workbenchState != âemptyââ
},
{
âkeyâ: âctrl+k ctrl+upâ,
âcommandâ: âworkbench.action.focusAboveGroupâ
},
{
âkeyâ: âctrl+k ctrl+downâ,
âcommandâ: âworkbench.action.focusBelowGroupâ
},
{
âkeyâ: âctrl+k ctrl+leftâ,
âcommandâ: âworkbench.action.focusLeftGroupâ
},
{
âkeyâ: âctrl+k ctrl+rightâ,
âcommandâ: âworkbench.action.focusRightGroupâ
},
{
âkeyâ: âctrl+q câ,
âcommandâ: âeditor.action.addCommentLineâ,
âwhenâ: âeditorTextFocus && !editorReadonlyâ
},
{
âkeyâ: âctrl+q uâ,
âcommandâ: âeditor.action.removeCommentLineâ,
âwhenâ: âeditorTextFocus && !editorReadonlyâ
},
{
âkeyâ: âctrl+q /â,
âcommandâ: âeditor.foldAllBlockCommentsâ,
âwhenâ: âeditorTextFocus && foldingEnabledâ
},
{
âkeyâ: âctrl+q 0â,
âcommandâ: âeditor.foldAllâ,
âwhenâ: âeditorTextFocus && foldingEnabledâ
},
{
âkeyâ: âctrl+q jâ,
âcommandâ: âeditor.unfoldAllâ,
âwhenâ: âeditorTextFocus && foldingEnabledâ
},
{
âkeyâ: âctrl+q kâ,
âcommandâ: âeditor.action.defineKeybindingâ,
âwhenâ: âeditorTextFocusâ
},
{
âkeyâ: âctrl+q mâ,
âcommandâ: âworkbench.action.editor.changeLanguageModeâ,
âwhenâ: â!notebookEditorFocusedâ
},
{
âkeyâ: âctrl+q pâ,
âcommandâ: âworkbench.action.files.copyPathOfActiveFileâ
},
{
âkeyâ: âctrl+q râ,
âcommandâ: âworkbench.action.files.revealActiveFileInWindowsâ
},
{
âkeyâ: âctrl+q oâ,
âcommandâ: âworkbench.action.files.showOpenedFileInNewWindowâ,
âwhenâ: âemptyWorkspaceSupportâ
},
{
âkeyâ: âctrl+q sâ,
âcommandâ: âworkbench.action.files.saveAllâ
},
{
âkeyâ: âctrl+q wâ,
âcommandâ: âworkbench.action.closeAllEditorsâ
},
{
âkeyâ: âctrl+q wâ,
âcommandâ: âworkbench.action.closeEditorsInGroupâ
},
{
âkeyâ: âctrl+q fâ,
âcommandâ: âworkbench.action.closeFolderâ,
âwhenâ: âemptyWorkspaceSupport && workbenchState != âemptyââ
},
{
âkeyâ: âctrl+q upâ,
âcommandâ: âworkbench.action.focusAboveGroupâ
},
{
âkeyâ: âctrl+q downâ,
âcommandâ: âworkbench.action.focusBelowGroupâ
},
{
âkeyâ: âctrl+q leftâ,
âcommandâ: âworkbench.action.focusLeftGroupâ
},
{
âkeyâ: âctrl+q rightâ,
âcommandâ: âworkbench.action.focusRightGroupâ
}
]
There is one thing left that I havenât figured out yet, the prompts in cursor itself still mention Ctrl-K instead of the now correct Ctrl-Q
Thank you, you are a lifesaver! I was about to give up.
For those of us coming from vscode, Ctrl-K (Command-K) remapping is a complete killer. I kept bringing up chat trying to comment lines, split a window vertically, close a pane, etc⌠I was about to uninstall cursor before I read this thread and redefined the keymappings. Strongly recommend you allow the definitions to be nicely redefined by the installer (especially when you are migrating from vscode)
What the, why did you overwrite CMD+K this is insane.
For folks looking to just have Ctrl+l
work in their terminal as usual (clear terminal), you can add the following to your Keyboard Shortcuts (JSON) settings:
{
"key": "ctrl+l",
"command": "aichat.newchataction",
"when": "!terminalFocus"
},
{
"key": "ctrl+l",
"command": "-aichat.newchataction"
}