aiux
PatternsPatternsCoursesCoursesNewsNewsResourcesResources
Overview

Setup

  • Download and Install Cursor
  • Navigate the Interface
  • Edit Code with AI Assistance

Prototype

  • Use Tab Completions
  • Chat with AI (Cmd+L)
  • Make Inline Edits (Cmd+K)
  • Build with Composer

Design-to-code

  • Convert Designs to Components
  • Build Frontend with React and Tailwind

Best Practices

  • Customize Your Workspace
  • Master Advanced Features
  • Best Practices and Team Workflows
  1. Guides
  2. /
  3. Cursor Course for Designers
  4. /
  5. Make Inline Edits (Cmd+K)
PrototypeLesson 6 of 12

Make Inline Edits (Cmd+K)

2 min readCursor for Designers

Cmd+K is your quick-edit tool. Highlight code and press Cmd+K to refactor, fix, or modify it with natural language instructions. No Chat panel needed.

The Cmd+K Workflow

1

Highlight code in your editor

Select the code you want to change.

2

Press Cmd+K (Mac) or Ctrl+K (Windows)

A prompt bar appears right above your code.

3

Type your instruction

Tell the AI what to do: "Make it faster", "Add error handling", "Use Tailwind instead"

4

Press Enter

Cursor edits the code inline and shows you the result.

Cursor editor showing smart rewrite feature with inline code transformation
Cmd+K inline editing: Smart rewrite transforming selected code

Example Edits

Here's what Cmd+K can do. Select the code and try:

Original code
if (user) { alert("Welcome"); }

Cmd+K → "Convert to console.log instead of alert"

After Cmd+K
if (user) { console.log("Welcome"); }

Cmd+K vs Chat (Cmd+L): When to Use Which

Both use AI, but for different situations:

  • **Cmd+K**: Quick changes to existing code (refactor, fix, adjust)
  • **Chat (Cmd+L)**: Explanations, debugging, understanding code, creating new code from scratch

Bonus: Cmd+K in Terminal

You can also use Cmd+K in the Terminal (bottom of Cursor) to generate shell commands from natural language:

1

Click in the Terminal

Focus the terminal at the bottom of the screen.

2

Press Cmd+K (Mac) or Ctrl+K (Windows)

A prompt appears in the terminal.

3

Describe what you want

"Remove all node_modules folders" or "Restart the dev server"

4

Press Enter

Cursor generates and runs the command.

Review Terminal Commands

Always review terminal commands before pressing Enter. The AI might misunderstand, and bad terminal commands can cause problems.

Inline Editing Mastered!

  • You can select code and use Cmd+K to edit it
  • You understand the difference between Cmd+K and Chat
  • You know how to use Cmd+K in the terminal
  • You're confident with quick, targeted edits

Perfect! Cmd+K is your speed tool for edits. Next, meet Composer—the power tool for generating entire features.

← Previous LessonChat with AI (Cmd+L)Next Lesson →Build with Composer
← Back to Cursor Course for Designers overview

On this page

  • The Cmd+K Workflow
  • Example Edits
  • Cmd+K vs Chat (Cmd+L): When to Use Which
  • Bonus: Cmd+K in Terminal

aiux

AI UX patterns from shipped products. Demos, code, and real examples.

Have an idea? Share feedback

Get daily AI UX news

Resources

  • All Patterns
  • Browse Categories
  • Contribute
  • AI Interaction Toolkit
  • Agent Readability Audit
  • Newsletter
  • Documentation
  • Figma Make Prompts
  • Designer Guides
  • All Resources →

Company

  • About Us
  • Privacy Policy
  • Terms of Service
  • Contact

Links

  • Portfolio
  • GitHub
  • LinkedIn
  • More Resources

Copyright © 2026 All Rights Reserved.