Cursor AI Keyboard Shortcuts: A Developer Guide (2026)

By Jay, editor

Published: May 1, 2026 · 8 min read

Cursor AI is a code editor for developers who want AI built directly into their workflow. Instead of sitting in a separate tool, the AI is reached from the editor itself. Learning its keyboard shortcuts is the difference between a good Cursor experience and a great one.

Table of Contents

  1. Core AI shortcuts
  2. Inline edit (Ctrl+K)
  3. AI chat (Ctrl+L)
  4. Agent (Ctrl+I)
  5. Editor navigation
  6. Workflow patterns

1. Core AI shortcuts at a glance

Windows / LinuxMacWhat it does
Ctrl + KCmd + KAI Inline Edit — modify selected code with natural language
Ctrl + LCmd + LToggle the Agent side panel (with code selected, starts a new chat with that selection)
Ctrl + ICmd + IToggle the Agent side panel
TabTabAccept AI suggestion
EscapeEscapeReject AI suggestion
Ctrl + Shift + LCmd + Shift + LAdd the selected code to Chat as context

2. Inline Edit (Ctrl+K) — your most-used shortcut

Ctrl+K is the heart of Cursor. Select any code, press Ctrl+K, describe what you want in plain English, and Cursor rewrites it. No context switching, no copy-paste into a chat window.

Best uses for Ctrl+K: Refactoring a function, adding error handling, translating code to another language, adding type annotations, or writing docstrings.
ActionHow to do it
Edit selected codeSelect code → Ctrl+K → describe the change
Apply the instructionEnter (Return on a Mac)
Cancel the editCtrl+Shift+Backspace (Cmd+Shift+Backspace on a Mac)
Iterate on the resultAdd a follow-up instruction and press Enter again
Ask a question instead of editingAlt+Enter (Option+Return on a Mac) in the edit box

3. AI Chat (Ctrl+L) — for discussions and exploration

Ctrl+L toggles the side panel where the chat with Agent lives; with code selected, it starts a new chat that carries the selection. Unlike Inline Edit, Chat preserves the conversation history and is better for exploratory questions, understanding code, and working through complex problems step by step.

Windows / LinuxMacWhat it does
Ctrl + LCmd + LToggle the side panel (chat)
Ctrl + N / Ctrl + RCmd + N / Cmd + RNew chat
Ctrl + Shift + LCmd + Shift + LAdd the selected code to the chat as context
@ in chat@ in chatAttach a file, folder, or other context with an @-mention
EnterReturnSend message — queued until the agent finishes its current task
Ctrl + EnterCmd + ReturnSend the message at once instead of queueing it
Pro tip: In Chat, type @filename.ts to add a file as context. Use this for "explain this code" or "what does this function do" queries.

4. Agent (Ctrl+I) — for multi-file changes

Ctrl+I toggles the side panel, which is where Agent runs. Cursor's docs describe Agent as the assistant that can complete complex coding tasks independently, run terminal commands, and edit code.

Windows / LinuxMacWhat it does
Ctrl + ICmd + IToggle the Agent side panel
Ctrl + EnterCmd + ReturnAccept all suggested changes
Ctrl + Shift + BackspaceCmd + Shift + BackspaceReject all suggested changes
Agent modes: Ctrl+. (Cmd+. on a Mac) opens the mode menu and Shift+Tab rotates between the agent modes. Agent can run terminal commands as part of a task — installing dependencies or running tests — according to your Run Mode settings. Best for scaffolding new features or fixing bugs that span multiple files.

Cursor's help says it uses the same default shortcuts as VS Code, so the editor keys below are VS Code's own:

Windows / LinuxMacWhat it does
Ctrl + PCmd + PQuick Open file
Ctrl + Shift + PCmd + Shift + PCommand Palette
Ctrl + `Ctrl + `Toggle terminal
Ctrl + BCmd + BToggle sidebar
Ctrl + SCmd + SSave file
Ctrl + ZCmd + ZUndo
Ctrl + YCmd + Shift + ZRedo

6. Effective Cursor workflow patterns

The TDD pattern with Cursor

Write a test first (describe the expected behavior), then select it and press Ctrl+L to open Agent with the test as context: "implement the function that makes this test pass." The agent works from the test you selected.

Code review pattern

Select any block of code, open Chat (Ctrl+L), and ask "what does this do, and are there any potential bugs?" The selected block goes along as context for the question.

Refactor with confidence

Select a function you want to refactor, press Ctrl+K, and type "refactor this to use async/await" or "extract this into smaller functions." Press Enter to apply it, add a follow-up instruction to refine it, or cancel with Ctrl+Shift+Backspace.

Interactive shortcut reference

View the Cursor AI Shortcuts Reference