All Articles

Cursor AI Keyboard Shortcuts: The Complete Developer Guide (2026)

Published: May 1, 2026 · 8 min read

Cursor AI has become the code editor of choice for developers who want AI built directly into their workflow. Unlike using a separate AI tool, Cursor integrates AI into every editing action. 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. Composer (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 + LOpen AI Chat sidebar
Ctrl + ICmd + IOpen Composer (multi-file AI edits)
TabTabAccept AI suggestion
EscapeEscapeReject AI suggestion
Ctrl + Shift + LCmd + Shift + LStart new AI chat
Ctrl + Shift + ICmd + Shift + IOpen Composer in new window

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. Works on any selection from a single line to an entire file.
ActionHow to do it
Edit selected codeSelect code → Ctrl+K → describe the change
Generate new codePlace cursor → Ctrl+K → describe what to generate
Accept the changeTab (or click Accept)
Reject the changeEscape (or click Reject)
Iterate on the resultCtrl+K again after accepting to refine further

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

Ctrl+L opens the AI Chat panel. 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 + LOpen Chat
Ctrl + Shift + LCmd + Shift + LNew Chat (clear history)
@ in chat@ in chatReference a file, folder, or symbol
EnterEnterSend message
Shift + EnterShift + EnterNew line in chat input
Pro tip: In Chat, type @filename.ts to add a file as context. The AI can read the full file and answer questions about it. Use this for "explain this code" or "what does this function do" queries.

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

The Composer is Cursor's most powerful feature. It can read and edit multiple files simultaneously, run terminal commands, and complete multi-step tasks autonomously in Agent mode.

Windows / LinuxMacWhat it does
Ctrl + ICmd + IOpen Composer
Ctrl + EnterCmd + EnterAccept all Composer changes
Ctrl + BackspaceCmd + BackspaceReject all Composer changes
Agent mode: Switch the Composer to Agent mode to let Cursor run terminal commands, install packages, and complete tasks autonomously. Best for scaffolding new features or fixing bugs that span multiple files.
Windows / LinuxMacWhat it does
Ctrl + PCmd + PQuick Open file
Ctrl + Shift + PCmd + Shift + PCommand Palette
Ctrl + `Ctrl + `Toggle terminal
Ctrl + BCmd + BToggle sidebar
Ctrl + /Cmd + /Toggle comment
Ctrl + SCmd + SSave file
Ctrl + ZCmd + ZUndo
Ctrl + Shift + ZCmd + 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+K: "implement the function that makes this test pass." Cursor reads the test and generates the implementation. Faster than writing the implementation yourself and explaining it separately.

Code review pattern

Select any block of code, open Chat (Ctrl+L), and ask "what does this do, and are there any potential bugs?" Cursor explains the code and flags issues. More effective than reading unfamiliar code alone.

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." Preview the diff before accepting — Cursor shows exactly what will change.

Interactive shortcut reference

View All Cursor AI Shortcuts