CursorInline editLevel 1: Basic prompts

What Happened to Inline Edit and Cmd+K in Cursor?

Inline edit is gone. Cursor's help says Cmd+K "used to open inline edit, which has been replaced by this workflow": select code, press Cmd+K or Cmd+L (Ctrl+K or Ctrl+L on Windows and Linux), and Agent opens with those lines referenced in its input. You type the change there, and it applies as a normal Agent edit.

Prompt to copy
Change only the selected lines in [file]:

[describe the one change, for example: add an early return if `items` is empty]

Keep the function signature and the error handling. Don't edit any other file, and don't reformat surrounding code. If this can't be done within the selection, stop and tell me why.
  1. 1Select code
  2. 2Cmd+K or Cmd+L
  3. 3Describe the change
  4. 4Review the diff
The workflow that replaced inline edit: the selection goes to Agent, and you review the result as a diff.

Try it now

  1. 1Select a few lines in any file and press Cmd+K (Ctrl+K on Windows and Linux). Agent opens with those lines referenced in the input.
  2. 2Type one specific change and press Return. The edit appears in the diff view.
  3. 3Check that only the selected code changed, then press Cmd+Return to accept all, or Cmd+Shift+Backspace to reject all. It worked if the diff is confined to the lines you chose.

Use it when

Small changes where you can see the exact code: a guard clause, a loop conversion, a clearer name in one function, a docstring. For new typing, Tab is usually faster. For changes across many files, describe the task to Agent without a selection and let it search.

Skip it when

Skip it when you can make the edit faster by hand, or when Tab already predicts it. Also skip the selection if you don't know where the code is. Cursor's docs say to let Agent find the files through its own search when you aren't sure which ones matter.

Why it works

The selection still gives the model a precise target, which is what made inline edit useful. What changed is the worker. The request now goes to the full agent, with its tools for search, reading files and running commands, so it isn't limited to the selected lines. That means it can also wander, so your wording has to set the limit that the old prompt box set for you. The result still appears in the diff view, where you can reject it.

Example

Say you select a nested .then() chain in orders.ts, press Cmd+K, and type "Convert this to async/await. Keep the error handling, and don't touch other functions." Agent edits those lines and the diff shows one function changed. Without the second sentence, a request this open could also lead it to update callers, which you'd then have to reject.

Going further

Three selection shortcuts do different things, and it's easy to mix them up. Cursor's shortcut reference lists Cmd+L or Cmd+K as Add selection to new chat, and Cmd+Shift+L as Add selection to Chat, which keeps your current thread. Use the second when the agent needs what it already learned. One more trap: in the Agents Window, Cmd+K opens the command palette for searching conversations, so the same key does something else there. To change any of this, open Keyboard Shortcuts with Cmd+R then Cmd+S, and remap the command.

Common mistakes

  • Following a pre-replacement tutorial and expecting a small prompt box over your code. The input is now the Agent panel.
  • Assuming the selection limits the edit. It's a reference, not a fence, so say "don't edit any other file" if you mean it.
  • Pressing Cmd+K in the Agents Window and wondering why a search palette opened.
  • Starting a new chat with Cmd+K when you wanted to keep context, instead of using Cmd+Shift+L.

Sources

Checked 6 November 2026. Products change often, so confirm details with the vendor.

Related

Beyond the course