Basics
Cursor Inline Edit (Cmd+K): What Replaced It
Cursor has replaced inline edit: selecting code and pressing Cmd+K now opens Agent with those lines referenced, instead of an edit prompt inside the file. Cmd+L does the same, and on Windows and Linux the keys are Ctrl+K and Ctrl+L. Type your instruction, press Return, then review the diff and reject anything you don't want.

On this page
What happened to inline edit in Cursor?
Inline edit was a prompt that opened on your selection and rewrote only those lines, without the chat panel. Cursor has replaced it with Agent. With code selected, Cmd+K on Mac or Ctrl+K on Windows and Linux now opens Agent with those lines referenced in its input, ready for your instructions. The old inline-edit help page now redirects to Cursor's Agent page, which notes the change.
Cmd+K on a helper — rename the variable, not the contract
0:38 · narratedRead this demo as text
- The fix lives inside filterResults — three lines, one local variable. Select just the body, then Cmd+K instead of Agent.
- One instruction, one variable, one file. The diff comes back inside the exact selection — read every renamed line before you touch Accept.
- Accepted. filterResults still takes the same arguments and returns the same shape. Source Control shows exactly one changed file — the boundary held.
Practice next: The hands-on module still teaches this old inline-edit flow.
Simulated Cursor 3.12 (macOS, light) — beta educational reconstruction, not the real product.
The biggest change is what your selection does. Inline edit used it for two jobs: to say which code you meant, and to limit the edit to the lines you highlighted. Agent uses the selection as a reference. It searches your codebase, reads the files it needs and can edit several of them.
Cursor's docs describe no way to limit Agent to the lines you selected, so put the limit in your instruction. Cursor's help asks you to be specific about what you want. For a small edit, that includes what must stay the same: "rename the local variable in this function and change nothing else" gives Agent the limit that the selection used to enforce.
When a change reaches a caller in another file, Agent can follow it there and edit that file too. After each run, check Source Control for files you didn't expect to change.
This exact topic is a hands-on Lesson: Make one small change and review the diff — about 7 minutes, free to read. Or try it live in the simulator →
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
How do I edit selected code with Cmd+K now?
The flow takes five steps, all from Cursor's Agent help page. The last step matters more than it did with inline edit, because Agent applies its edits as it works and can change files beyond your selection.
- 1Select the code you want to change.
- 2Press
Cmd+KorCmd+Lon Mac, orCtrl+KorCtrl+Lon Windows and Linux. Agent opens with those lines referenced in the input. - 3Type your instruction, for example "Convert this to an async function." Be specific about what you want.
- 4Press Return. Agent explores your codebase and starts making changes.
- 5Watch the edits appear in the diff view, and reject anything you don't want.
One small change, read every hunk
0:33 · narratedRead this demo as text
- Open the file with the label. Select just line 12. That selection is the blast radius. Cursor should only touch what you highlighted.
- One line? Use Inline Edit. Command-K. Not Agent. Type the exact reword, then wait for the hunk.
- Read every line of that hunk before you Accept. Then check Source Control. One modified file. That is your receipt.
Practice next: The hands-on module also uses the old inline-edit flow.
Simulated Cursor 3.12 (macOS, light) — beta educational reconstruction, not the real product.
Cmd+K and Cmd+L both start a new chat with your selection. To add a selection to the chat you already have open, Cursor's shortcut reference lists Cmd+Shift+L on Mac.
To refine the result, reply in the same chat. You don't have to wait for Agent to finish: a message you send while it works waits in a queue and runs when the current task is done. Inline edit had a follow-up box under its prompt for the same job.
What happens after I press Return?
Agent applies its edits as it works, before you review them. Inline edit worked differently: it held a proposal inside your selection until you clicked Accept or Reject. With Agent, you review the changes after they are applied, with these controls.
- Reject in the diff view
- Reject any change you don't want while you review.
- Accept or reject all
- With suggested changes on screen,
Cmd+Returnaccepts all of them andCmd+Shift+Backspacerejects all of them (Mac keys). - Stop
- Click Stop to halt Agent mid-task, then redirect it or try a different approach.
- Restore Checkpoint
- Hover over an earlier message and click Restore Checkpoint at the bottom right to roll back every change Agent made after that point.
Restore Checkpoint reverts files only. The messages stay in the conversation, so to shorten the conversation itself, fork the chat from an earlier message.
Read every changed line before you keep a change. When we captured the old inline-edit flow in Cursor 3An older release label for Cursor's multi-agent interface; current product guidance calls the active surface the Agents Window. Press Enter for the full definition..12 for this site's UI references, a one-line reword came back with an extra blank line nobody had asked for. It sat in the same block as the requested change, and only reading both lines caught it. An Agent diff can span several files, so read every file in it.
How strict to be depends on who reads the diff after you. Alone in your own repo, an extra line costs you a git checkout once you notice it. In a pull request, every extra line costs a reviewer time, and the reviewer can't tell which lines you meant. On a team with reviewers, reject the extra lines and ask again.
How do I ask about selected code without changing it?
Use Ask modeA read-only mode for asking questions about a codebase without changing files; the safe way to explore unfamiliar or legacy code. Press Enter for the full definition.. Ask is read-only: it answers questions about code and architecture, and it can't edit files. To switch, press Shift+Tab in the chat input to cycle through the modes, or pick Ask from the mode picker in the Agent panel.
- Action
- Send a selection to Agent (replaces inline edit)
- Mac
- ⌘K or ⌘L
- Windows / Linux
- CtrlK or CtrlL
- Action
- Cycle through modes, including Ask
- Mac
- ⇧⇥
- Windows / Linux
- ⇧⇥
- Action
- Open keyboard shortcuts to remap a key
- Mac
- ⌘R, then ⌘S
- Windows / Linux
- CtrlR, then CtrlS
| Action | Mac | Windows / Linux |
|---|---|---|
| Send a selection to Agent (replaces inline edit) | ⌘K or ⌘L | CtrlK or CtrlL |
| Cycle through modes, including Ask | ⇧⇥ | ⇧⇥ |
| Open keyboard shortcuts to remap a key | ⌘R, then ⌘S | CtrlR, then CtrlS |
Keys from Cursor's Agent and keyboard shortcuts help pages.
Pick the mode before you send. Each mode uses its own context, so switching modes partway through a conversation starts a fresh context window.
Inline edit had a question mode of its own, opened with ⌥↵ on Mac or ⌥↵ on Windows and Linux. Typing "do it" then applied the change it suggested. That mode went away with inline edit. When Ask suggests a change you want, switch to Agent and describe the change again, because Agent starts with a fresh context window.
Do Cmd+K and Cmd+L do the same thing now?
Yes. With code selected, both open Agent with those lines referenced, and so do Ctrl+K and Ctrl+L on Windows and Linux. They used to be two routes. Cmd+K kept the edit inside your selection, and Cmd+L handed the selection to Agent for changes that needed more than one file.
What you give up is the boundary. Everything Agent touches, including files you never opened, is something you then have to read.
You don't need Plan modeA mode that makes no edits: it researches the codebase and produces an editable plan you review before any code changes. Press Enter for the full definition. for edits this size. Cursor recommends Plan mode for complex features and for tasks that touch many files or systems, and its docs say quick changes can go straight to Agent. A selection-sized edit fits that description.
Import your VS Code keymap and your two-step ⌘K shortcuts stop working, because Cursor uses ⌘K for its own shortcut and moved the chord leader. On Mac the leader is ⌘R, so ⌘R then ⌘S opens keyboard shortcuts. On Windows and Linux, Cursor's help page opens the same screen with CtrlR then CtrlS, and a Cursor staff answer on the forum names CtrlM as the leader for other chords.
⌘K no longer opens a prompt bar in the terminal either. Cursor staff confirmed on the forum that terminal command generation was retired with inline edit, and the old terminal page in Cursor's docs now redirects to the Agent page. To get a shell command, ask Agent for it. The keybindings.json guide has the before-and-after mapping and the setting that hands the leader back.
Frequently asked questions
What is the keyboard shortcut for inline edit in Cursor?
Inline edit has been replaced. Select code and press ⌘K or ⌘L on Mac, or CtrlK or CtrlL on Windows and Linux, and Agent opens with those lines referenced. Type your instruction and press Return.
Is inline edit still in Cursor?
No. Cursor's help says ⌘K used to open inline edit and that sending the selection to Agent has replaced it. The old inline-edit help page now redirects to the Agent page, and ⌘K no longer generates commands in the terminal either.
Does Agent change my code immediately?
Yes. Agent applies its edits as it works. Review them in the diff view and reject anything you don't want, or hover over an earlier message and click Restore Checkpoint to roll back every change made after it.
How do I ask about selected code without changing it?
Use Ask mode, which is read-only. Press ⇧⇥ in the chat input to cycle through the modes, or pick Ask from the mode picker. Switch before you send, because each mode starts with a fresh context window.
Can I limit Agent to the lines I selected?
Cursor's docs don't describe a setting for that. State the limit in your instruction, then read the diff and reject any change outside the lines you meant.
Sources & last verified
- Cursor - Inline Edit
- Cursor - Agent mode
- Cursor docs: Keyboard shortcuts
- Cursor Help: Keyboard shortcuts
- Cursor Forum: Cmd+K retired from the terminal (staff answer)
Cursor ships frequently. Last updated October 28, 2026.