Table of Contents
· ngaicode · Cursor · 8 min read

Cursor Tutorial: How to Use Cursor AI Editor in 2026

Complete Cursor tutorial for 2026: learn Agent Mode, Composer, keyboard shortcuts, MCP setup, and advanced features to maximize your AI coding workflow.

Cursor Tutorial: How to Use Cursor AI Editor in 2026

Cursor is the most powerful AI-powered code editor in 2026, combining the familiar VS Code interface with advanced AI features like Agent Mode (autonomous multi-file editing), Composer (structured refactoring), and multi-model support (Claude, GPT, Grok).

This complete tutorial walks you through everything from installation to advanced workflows, helping you code 10x faster with AI assistance.


What Is Cursor?

Cursor is a VS Code fork with built-in AI capabilities. Unlike GitHub Copilot (which is an extension), Cursor integrates AI at the core level, enabling features that extensions cannot provide:

  • Agent Mode: AI edits multiple files autonomously
  • Composer: Plan and preview large refactors before applying
  • Multi-model: Switch between Claude, GPT, and Grok per task
  • MCP: Connect to external data sources (Notion, GitHub, Figma)

Step 1: Installation and Setup

Download and Install

  1. Go to cursor.com
  2. Download for your OS (Windows, Mac, Linux)
  3. Install like any app
  4. On first launch, Cursor imports your VS Code settings, extensions, and keybindings

Migration tip: Cursor is a VS Code fork, so all your VS Code extensions work immediately.

Sign Up and Choose a Plan

PlanPriceFeatures
HobbyFree (14 days)50 requests/month, basic models
Pro$20/month500 fast requests, Claude Sonnet, GPT-4o, Agent Mode
Pro+$60/month2,000 requests, priority access
Ultra$200/monthUnlimited requests, all premium models

Recommendation: Start with the 14-day free trial, then upgrade to Pro ($20/month) for serious development.

Get Cursor Pro from $15/month

Configure Your First API Key (Optional)

Cursor Pro includes built-in models, but you can add your own API keys for:

  • OpenAI GPT models
  • Anthropic Claude models
  • Custom models via MCP

Settings → Models → Add API Key


Step 2: Core Features and Keyboard Shortcuts

1. Autocomplete (Tab)

What it does: Suggests code as you type, press Tab to accept.

Keyboard shortcut: Just type, press Tab to accept

Use case: Writing new code line-by-line

Example:

// Type: function calculate
// Cursor suggests:
function calculateTotal(items: Item[]): number {
  return items.reduce((sum, item) => sum + item.price, 0);
}
// Press Tab to accept

Pro tip: Cursor learns from your codebase. The more you code, the better suggestions become.


2. Cmd+K (Inline Edit)

What it does: Edit code inline with AI assistance.

Keyboard shortcut:

  • Mac: Cmd+K
  • Windows/Linux: Ctrl+K

Use case: Quick fixes, refactors, improvements within one file

Example workflow:

  1. Select code to modify
  2. Press Cmd+K
  3. Type instruction: “Add error handling”
  4. Cursor rewrites the selected code
  5. Accept or reject the change

Common prompts:

  • “Add TypeScript types”
  • “Convert to async/await”
  • “Add JSDoc comments”
  • “Optimize this function”

3. Cmd+L (Chat)

What it does: Chat with AI about your code, ask questions, get explanations.

Keyboard shortcut:

  • Mac: Cmd+L
  • Windows/Linux: Ctrl+L

Use case: Understanding code, debugging, asking “how to” questions

Example:

You: "How does this authentication middleware work?"
Cursor: [Reads the file and explains the logic step-by-step]

You: "Why is this API call failing?"
Cursor: [Analyzes logs and suggests fixes]

Pro tip: Use @filename to reference specific files in your questions.


4. Cmd+I → Agent Mode (Multi-file)

What it does: AI autonomously edits multiple files, runs commands, and verifies changes.

Keyboard shortcut:

  • Mac: Cmd+I → select “Agent”
  • Windows/Linux: Ctrl+I → select “Agent”

Use case: Large refactors, feature implementation, bug fixes across multiple files

Example workflow:

You: "Refactor the user authentication to use JWT instead of sessions"

Cursor Agent:
1. Reads auth middleware, user model, session config (8 files)
2. Generates JWT utility functions
3. Updates all authentication endpoints
4. Modifies the database schema
5. Updates tests
6. Runs tests to verify everything works
7. Presents the complete refactor for your review

When to use Agent Mode:

  • Multi-file refactors (3+ files)
  • Implementing new features
  • Debugging complex issues
  • Migrating libraries or frameworks

When NOT to use Agent Mode:

  • Simple one-line changes (use Cmd+K)
  • Quick questions (use Cmd+L)
  • Learning/exploring (Agent Mode consumes more quota)

5. Composer (Structured Refactoring)

What it does: Plan and preview large changes before applying them.

How to access:

  • Click “Composer” button in top-right
  • Or press Cmd+Shift+I (Mac) / Ctrl+Shift+I (Windows/Linux)

Use case: When you want to see the full plan before AI makes changes

Workflow:

  1. Open Composer
  2. Describe the change: “Convert REST API to GraphQL”
  3. Composer shows a step-by-step plan
  4. Review the plan
  5. Click “Apply” to execute
  6. Review diff for each file
  7. Accept or reject each change individually

Composer vs Agent Mode:

  • Composer: You control each step, see diffs before applying
  • Agent Mode: AI works autonomously, you review at the end

Step 3: Advanced Features

Multi-Model Switching

Cursor supports multiple AI models. Choose the best one for each task:

Claude Sonnet 3.7: Best for complex refactors, long context (200K tokens)
GPT-4o: Fastest, best for autocomplete and quick tasks
GPT-5.6: Best reasoning for algorithms
o1-preview: Advanced reasoning for complex problems

How to switch models:

  1. Open settings (Cmd+,)
  2. Search “model”
  3. Choose default model
  4. Or switch per-request in Chat/Agent panels

Pro tip: Use GPT-4o for autocomplete (fast), Claude Sonnet for Agent Mode (better at multi-file).


Using @Commands for Context

Add specific context to your AI requests:

  • @Files: Include specific files
  • @Folders: Include entire folders
  • @Codebase: Search entire codebase
  • @Docs: Reference documentation
  • @Web: Search the web
  • @Git: Reference git history

Example:

@Files src/auth/middleware.ts @Files src/models/user.ts
"Make these two files consistent with each other"

MCP (Model Context Protocol) Setup

MCP lets Cursor access external data sources:

Available MCP servers:

  • GitHub (issues, PRs, code search)
  • Notion (documentation, notes)
  • Figma (design files)
  • Linear (project management)
  • Slack (team communication)

Setup MCP:

  1. Settings → Features → Model Context Protocol
  2. Click ”+ Add MCP server”
  3. Choose a server (e.g., GitHub)
  4. Authenticate with your account
  5. Now Cursor can read GitHub issues, PRs, etc.

Use case example:

You: "@GitHub fetch issue #245 and fix the bug"
Cursor: [Reads the GitHub issue, understands the bug, fixes it across multiple files]

Learn more about MCP setup


.cursorrules (Custom Instructions)

Create a .cursorrules file in your project root to give Cursor project-specific instructions:

Example .cursorrules:

# Project Rules

## Code Style

- Use TypeScript strict mode
- Prefer functional components in React
- Use async/await over promises
- Add JSDoc for public functions

## Naming Conventions

- Components: PascalCase
- Functions: camelCase
- Constants: UPPER_SNAKE_CASE

## Testing

- Write tests for all new features
- Use Jest and React Testing Library
- Aim for 80%+ coverage

## Imports

- Absolute imports from `~/`
- Group by: React, external, internal, styles

Cursor reads .cursorrules and follows your project conventions automatically.


Step 4: Real-World Workflows

Workflow 1: Implementing a New Feature

Task: Add user authentication to an app

Steps:

  1. Open Composer (Cmd+Shift+I)
  2. Prompt: “Add JWT authentication with login/register endpoints”
  3. Review the plan (Composer shows 10 steps)
  4. Click “Apply”
  5. Review each file diff
  6. Accept changes
  7. Run tests to verify
  8. Commit to git

Time saved: 2-3 hours → 20 minutes


Workflow 2: Debugging a Complex Bug

Task: API call fails intermittently

Steps:

  1. Open Chat (Cmd+L)
  2. Prompt: “@Files api/auth.ts Why does authentication fail sometimes?”
  3. Cursor analyzes the file and logs
  4. Cursor: “Race condition in token refresh logic”
  5. You: “Fix it”
  6. Cursor rewrites the problematic section
  7. Test and verify

Time saved: 1-2 hours → 10 minutes


Workflow 3: Refactoring Legacy Code

Task: Refactor a messy 500-line component

Steps:

  1. Open Agent Mode (Cmd+I → Agent)
  2. Prompt: “Refactor UserProfile.tsx: extract components, add TypeScript types, improve performance”
  3. Agent works autonomously:
    • Splits into 5 smaller components
    • Adds TypeScript interfaces
    • Optimizes re-renders with useMemo
    • Updates tests
  4. Review the changes
  5. Accept and commit

Time saved: 4-6 hours → 30 minutes


Step 5: Pro Tips and Best Practices

1. Use Specific Prompts

❌ Bad: “Make this better”
✅ Good: “Add error handling, TypeScript types, and unit tests”

❌ Bad: “Fix bug”
✅ Good: “Fix the authentication timeout issue in auth.ts line 45”

2. Break Large Tasks into Steps

Instead of: “Rewrite the entire authentication system”

Do this:

  1. “Extract JWT utility functions”
  2. “Update login endpoint to use JWT”
  3. “Update middleware to verify JWT”
  4. “Add refresh token logic”

Smaller steps = better results + easier to review.

3. Review Before Accepting

Always review AI-generated code:

  • Check for security issues
  • Verify logic correctness
  • Ensure tests pass
  • Run the app to confirm it works

AI is powerful but not perfect. You’re still the engineer.

4. Pin Your Preferred Model

If you prefer Claude for refactors and GPT for autocomplete:

  1. Settings → Models
  2. Set “Autocomplete model” to GPT-4o
  3. Set “Chat/Agent model” to Claude Sonnet 3.7

This prevents quota waste on the wrong model.

5. Monitor Your Quota

Cursor Pro gives 500 fast requests/month:

  • 1 autocomplete = 0 credits (free)
  • 1 Cmd+K = 1 credit
  • 1 Agent Mode task = 1-3 credits

Check remaining quota: Settings → Usage

If you run out, either:

  • Wait until next month
  • Upgrade to Pro+ ($60/month, 2,000 credits)
  • Use your own API key (pay per token)

Learn how to optimize quota usage


Step 6: Common Issues and Solutions

Issue 1: “Quota exceeded”

Solution:

  • Use Cmd+K for small changes (1 credit vs Agent Mode 3 credits)
  • Pin GPT-4o for fast tasks (cheaper than Claude)
  • Upgrade to Pro+ or use your own API key

Issue 2: Agent Mode is slow

Solution:

  • Agent Mode analyzes multiple files, runs tests, verifies changes
  • For quick edits, use Cmd+K instead
  • Reduce the number of files Agent needs to read

Issue 3: Autocomplete suggestions are wrong

Solution:

  • Cursor learns from your codebase over time
  • Add a .cursorrules file with your project conventions
  • Use @Files to give more context for specific suggestions

Issue 4: Can’t install extensions

Solution:

  • Cursor uses VS Code extensions directly
  • Open Extensions panel (Cmd+Shift+X)
  • Search and install like VS Code

Frequently Asked Questions

Is Cursor better than GitHub Copilot?

Cursor has more advanced features (Agent Mode, Composer, multi-model). Copilot has faster autocomplete and costs less. Choose Cursor for complex projects, Copilot for simple autocomplete.

Do I need to learn new shortcuts?

No. Cursor uses VS Code shortcuts by default. The AI features add a few new shortcuts (Cmd+K, Cmd+L, Cmd+I), but all your VS Code muscle memory works.

Can I use Cursor with my existing projects?

Yes. Cursor works with any project. Just open the folder in Cursor like you would in VS Code.

Does Cursor work offline?

No. Cursor requires internet to access AI models. Autocomplete and basic editing work offline, but AI features require a connection.

How much does Cursor cost?

$20/month for Pro (500 fast requests). Free 14-day trial available. Get Cursor Pro from $15/month


Next Steps

Now that you understand Cursor’s core features, try these:

  1. Install Cursor and complete the 14-day free trial
  2. Try Agent Mode on a real refactoring task in your codebase
  3. Set up MCP to connect GitHub or Notion
  4. Create a .cursorrules file with your project conventions
  5. Compare models (Claude vs GPT) for different tasks

Get Cursor Pro | View Pricing | Contact Us


Related Articles:

Back to Blog

Related Posts

View All Posts »

Cursor Assistant Usage Guide 2026

CursorFree Assistant APP guide — install assistant on Win/Mac/Linux, activate license, fix Connection Error, Authentication error, restart Cursor

whatsapp chat