AI logoAIv3BEGINNER

Cursor

Cursor AI cheat sheet with keyboard shortcuts, AI-powered code generation, chat commands, and editor configuration tips with examples.

12 min read
aiideeditorproductivitycoding
First page of the Cursor PDF cheat sheet

PDF · 2 pages

Cursor PDF cheat sheet

A two-page Cursor reference for printing or offline use.

Open PDF
Loading your progress

Setup

Install the Cursor desktop editor and open a project from the terminal.

Install Cursor

Install the desktop app, sign in, and open a project folder.

bash
# macOS or Windows: download and run the installer
# https://cursor.com/download

# Debian or Ubuntu, after adding Cursor's apt repository
sudo apt install cursor

# RHEL or Fedora, after adding Cursor's yum repository
sudo dnf install cursor

# Open the current folder (or use File > Open Folder)
cursor .
📌 Native installers for macOS (.dmg) and Windows (.exe); apt, dnf or an AppImage on Linux
💡 Import VS Code extensions, themes, settings and keybindings in Cursor Settings > General > Account > VS Code Import
🔍 The apt and dnf packages are preferred over the AppImage: they add desktop icons, automatic updates and the command-line tools
🎯 Sign in, open a project folder, then press Cmd/Ctrl+I and ask Agent to explain the codebase
installdesktopclieditor

Essential Shortcuts

Core keyboard shortcuts for everyday use

AI Chat & Panel

Access AI features quickly

bash
# Open the Agent panel
Cmd/Ctrl+I         # Toggle the Agent side panel
Cmd/Ctrl+L         # Open the panel; with code selected, add it to a new chat
Cmd/Ctrl+Shift+L   # Add the selection to the current chat

# Chat input
Enter              # Send; queues the message while Agent is working
Cmd/Ctrl+Enter     # Send now and skip the queue
Cmd/Ctrl+Shift+Backspace  # Cancel generation
Shift+Tab          # Rotate between Agent, Ask, Plan and Debug

# Suggested changes
Cmd/Ctrl+Enter     # Accept all changes
Cmd/Ctrl+Shift+Backspace  # Reject all changes

# Navigation
Cmd/Ctrl+N         # New chat
Cmd/Ctrl+T         # New chat tab
Cmd/Ctrl+[         # Previous chat
Cmd/Ctrl+]         # Next chat
Cmd/Ctrl+W         # Close chat
Esc                # Unfocus the input
bash
# Example: fix selected code with Agent
1. Select the problem code
2. Press Cmd/Ctrl+L to open Agent with those lines referenced
3. Type: "Fix the type errors in this function"
4. Press Enter to send
5. Review the edits in the diff view
6. Press Cmd/Ctrl+Enter to accept all changes

# Example: follow up while Agent is busy
Enter              # Queued: runs when the current task finishes
Cmd/Ctrl+Enter     # Sent now: processed right away
💡 Cmd is the macOS key; use Ctrl on Windows and Linux
⚡ Cmd/Ctrl+L with code selected opens Agent with those lines referenced
🔍 Queued messages run in order when Agent finishes; drag to reorder them
📌 Any shortcut can be remapped in Keyboard Shortcuts (Cmd/Ctrl+R then Cmd/Ctrl+S)
chataishortcuts

Cmd/Ctrl+K no longer opens an inline edit box: it sends your selection to Agent

bash
# Inline edit was replaced by Agent
Cmd/Ctrl+K         # Same as Cmd/Ctrl+L: open Agent with the selection referenced

# In the Agent input
Enter              # Send the request
Cmd/Ctrl+Shift+Backspace  # Cancel generation

# Review the edits Agent applied
Cmd/Ctrl+Enter     # Accept all changes
Cmd/Ctrl+Shift+Backspace  # Reject all changes

# Agents Window only
Cmd/Ctrl+K         # Command palette: search across conversations
bash
# Example: refactor a function
1. Select the function
2. Press Cmd/Ctrl+K
3. Type: "Convert to async/await"
4. Press Enter
5. Watch the edit appear in the diff view
6. Accept it, or reject what you do not want
💡 In the editor, Cmd/Ctrl+K and Cmd/Ctrl+L now do the same thing
⚡ Agent applies edits as it works; review them in the diff view
🔍 Restore Checkpoint on an earlier message rolls the files back
📌 In the Agents Window, Cmd/Ctrl+K opens the command palette instead
inlineeditrefactor

Tab Completion

AI-powered code completions

bash
# Accept suggestions
Tab                # Accept the full suggestion
Cmd/Ctrl+Right     # Accept the next word
Esc                # Reject (or just keep typing)

# After an edit
Tab                # Jump to the next predicted edit location

# Turn Tab on or off
Tab indicator (bottom right)
- Snooze for a chosen duration
- Disable globally
- Disable for specific file extensions

# More settings
Cursor Settings > Tab
bash
# Example: Tab completion
# Start typing a function:
function calc

# Tab accepts the multi-line suggestion:
function calculateTotal(items) {
  return items.reduce((sum, item) => sum + item.price, 0)
}

# Tab again jumps to the next likely edit, even in another file
💡 Tab works from your recent edits, the surrounding code and linter errors
⚡ Suggestions can change several lines and add missing imports
🔍 A portal window at the bottom of the editor offers jumps into other files
📌 Rules do not apply to Tab, and your own API keys are not used for it
tabcompletionautocomplete

Context Management

Control what AI sees and references

Include relevant code and files

bash
# Selection
Cmd/Ctrl+Shift+L   # Add selected code to the current chat
Cmd/Ctrl+L         # Add selection to a new chat

# Clipboard (code or logs)
Cmd/Ctrl+V         # Paste copied code as a reference
Cmd/Ctrl+Shift+V   # Paste copied code as plain text

# In the chat input
@                  # Mention files, folders and other context
/                  # Commands and skills
Cmd/Ctrl+Enter     # Search codebase in chat

# @ mention types
@auth.ts                          # A file
@src/components/                  # A folder
@Terminals                        # Terminal output
@Chats                            # An earlier conversation
@Browser                          # The built-in browser
@Commit (Diff of Working State)   # Uncommitted changes
@Branch (Diff with Main)          # Your whole branch diff
bash
# Example: several files
@user.model.ts @auth.service.ts How do these interact?

# Example: review what you changed
@Commit (Diff of Working State) Any bugs in this diff?

# Example: terminal output
@Terminals Why did the build fail?
💡 Type @ and start typing; Cursor suggests matches
⚡ Not sure which files matter? Skip the mention and let Agent search
🔍 Paste or drag images into the input for UI work and error screenshots
📌 Type @ again to attach as many items as you need
contextreferencesearch

Set persistent coding rules and patterns

yaml
# Where rules live
.cursor/rules/*.mdc     # Project rules, version-controlled
AGENTS.md               # Plain Markdown rules (root or subfolders)
CLAUDE.md               # Read the same way as AGENTS.md
~/.cursor/rules/        # User rule files, this machine only
Customize > Rules       # User rules, synced with your account

# Rule file: .cursor/rules/api.mdc
---
description: API standards
globs: src/api/**/*.ts, src/**/*.api.ts
alwaysApply: false
---
- Use REST conventions
- Include error handling
- Add JSDoc comments

# Rule types
Always Apply             # alwaysApply: true, every chat
Apply to Specific Files  # globs match a file in context
Apply Intelligently      # Agent decides from the description
Apply Manually           # Only when you @-mention the rule

# Legacy: .cursorrules will be deprecated.
# Move it into a rule set to Always Apply.
yaml
# .cursor/rules/style.mdc
---
description: Code style guide
alwaysApply: true
---
- Use TypeScript strict mode
- Prefer const over let
- Use async/await over callbacks

# Create a rule
/create-rule                         # In chat: Agent writes the rule file
Cmd/Ctrl+Shift+P > New Cursor Rule   # Command palette
Customize > Rules > Add Rule         # Sidebar
💡 Rule files must end in .mdc: a plain .md file in .cursor/rules is ignored
⚡ When rules conflict: Team Rules, then Project Rules, then User Rules
🔍 globs takes one or more patterns separated by commas
📌 Rules apply to Agent in every mode, but not to Tab or Bugbot
rulesconfigurationcontext

Memories

Cursor 3 has no Memories feature in the editor: rules carry what should persist

bash
# The Cursor 3 docs describe no Memories feature in the editor.
# Models keep nothing between chats: rules are the persistent context.

# Save a preference as a rule
/create-rule             # Describe it; Agent saves a rule in .cursor/rules/
Customize > Rules        # User rules for all your projects
AGENTS.md                # Plain Markdown instructions in the repo

# Reuse earlier work
@Chats                   # Reference a previous conversation

# Where "Memories" still exists
# Automations (Cloud Agents): a tool that keeps notes across
# runs of the same automation, MEMORIES.md by default
bash
# Example: make a preference stick
You: /create-rule Always use Zod for validation
# Agent saves a rule file in .cursor/rules/

# Later chats
You: Add validation to this API
# Agent follows the rule and uses Zod
💡 Models keep no memory between chats; rules give them persistent context
⚡ Start simple: add a rule when Agent repeats the same mistake
🔍 Agent can search your past conversations on its own when it needs context
📌 Commit .cursor/rules so the whole team gets the same rules
memorieslearningcontext

AI Models & Configuration

Configure AI providers and models

Model Selection

Choose and switch between AI models

bash
# Switch models
Cmd/Ctrl+/         # Loop between models
Cmd+Opt+/          # Model toggle (macOS form in the docs)
Model picker       # Dropdown in the chat input

# Auto
Auto               # Cursor picks a model for each request

# Defaults and keys
Cursor Settings > Models   # Default model, your own API keys
Cmd/Ctrl+Shift+J           # Open Cursor Settings

# Privacy Mode is not a model setting
Cursor Settings > General > Privacy Mode
bash
# Example: match the model to the task
Faster model          # Quick edits and routine tasks
More capable model    # Complex reasoning, multi-file refactors
Auto                  # Everyday work, picked per request

# Switch mid-conversation: explore with a fast model,
# then pick a stronger one for the implementation
💡 The model list changes often and depends on your plan: check the picker
⚡ You can switch models in the middle of a conversation
🔍 Context windows differ per model; Max Mode exists only on legacy request-based plans
📌 Privacy Mode keeps your code out of training; it is a toggle in Cursor Settings > General
modelsaiconfiguration

Use your own API keys

bash
# Add a key in Cursor Settings > Models

# Providers
- OpenAI          # Standard, non-reasoning chat models
- Anthropic
- Google
- Azure OpenAI    # Models deployed in your Azure instance
- AWS Bedrock     # Access key and secret key, or IAM roles in the dashboard

# Steps
1. Open Cursor Settings (Cmd/Ctrl+Shift+J)
2. Go to Models
3. Find the provider and paste your key
4. Click Save

# Good to know
- The provider bills you directly for the model cost
- Keys work with chat models only; Tab keeps using Cursor's models
- The key is not stored on Cursor's servers, but it is sent with every request
bash
# Example: use your own OpenAI key
Cursor Settings > Models > OpenAI
Paste the key, then click Save
# That provider's models now appear in the model picker

# If a key is invalid or rejected
# Requests to that provider fail until you update or remove the key
💡 On individual plans, requests with your own key do not draw from your included usage
⚡ On Teams and Enterprise the Cursor Token Rate still applies to eligible models
🔍 Zero Data Retention does not cover requests made with your own key
📌 An invalid key makes that provider's requests fail until you fix or remove it
apikeysconfiguration

Agent Mode

Autonomous AI coding assistant

Let AI complete complex tasks autonomously

bash
# Open Agent
Cmd/Ctrl+I         # Open the Agent panel
Shift+Tab          # Rotate between modes
Cmd/Ctrl+.         # Mode menu

# Modes
Agent              # Builds, refactors, fixes: edits files, runs commands
Ask                # Read-only answers about your code
Plan               # Writes a plan first; click Build to run it
Debug              # Adds logs, asks you to reproduce, then fixes

# What Agent can do
- Search the codebase and the web
- Edit multiple files
- Run terminal commands
- Create checkpoints before significant changes
- Delegate work to subagents

# Undo
Restore Checkpoint # On an earlier message: roll the files back
bash
# Example: Agent building a feature
You: "Add user authentication with JWT"

Agent:
1. Searches for existing auth code
2. Creates the auth middleware
3. Adds login and logout endpoints
4. Updates the user model
5. Runs the tests
# Edits show up in the diff view as it works

# Example: a long-lived objective (still rolling out)
/goal fix all flaky tests and make CI green
💡 Use Agent for most tasks, Ask to understand code, Plan for multi-file features, Debug for hard bugs
⚡ Checkpoints are local and separate from Git; restoring reverts files, not the conversation
🔍 Edits are applied as Agent works; review them in the diff view and reject what you do not want
📌 Each mode has its own context window; start a new chat when you change tasks
agentautonomousai

Background Agents are now Cloud Agents: tasks you hand off to a VM in the cloud

bash
# Background Agents are now called Cloud Agents

# Start one
Cloud                    # In the dropdown under the agent input
cursor.com/agents        # Web and mobile
@Cursor <prompt>         # Slack or Linear
@cursor <prompt>         # Comment on a GitHub PR or issue
& <prompt>               # Cursor CLI: hand the message to a Cloud Agent

# What it does
- Runs in its own VM with your repo and dependencies
- Works on a separate branch and pushes it for handoff
- Opens a pull request with screenshots, videos and logs
- Keeps running after you close your laptop

# Setup
- An account admin connects GitHub, GitLab, Bitbucket or Azure DevOps
- Environment: agent-led setup, a snapshot, or .cursor/environment.json
bash
# Example: hand a task to the cloud
1. Commit or stash your local changes
2. Choose Cloud under the agent input
3. Type: "Upgrade the test runner and fix the snapshots"
4. Close the laptop; check cursor.com/agents later
5. Review the pull request and its artifacts

# Example: from Slack
@Cursor fix the login bug in the checkout flow
💡 Cloud Agents were formerly called Background Agents
⚡ Run as many as you want in parallel; none of them needs your machine
🔍 Move to Cloud does not carry uncommitted changes: commit or stash first
📌 Cmd/Ctrl+E now toggles the Agent layout; it does not open a panel for these agents
backgroundagentmonitoring

Advanced Features

Power user features and integrations

Command Palette

Access all commands quickly

bash
# Open the command palette
Cmd/Ctrl+Shift+P   # Command palette

# Commands named in the docs
"New Cursor Rule"                    # Create a project rule
"Open Agents Window"                 # Agent-first window
"Open IDE"                           # Back to the editor
"Reindex"                            # When Agent misses files
"Cursor: Attempt Update"             # Check for an update
"Cursor Settings"                    # Open Cursor Settings
"Keyboard Shortcuts"                 # Remap any key
"Developer: Export Logs"             # Logs for a support request
"Show Running Extensions"            # CPU and memory per extension
"Terminal: Select Default Profile"   # The shell Agent uses
bash
# Example: common palette workflows
Cmd/Ctrl+Shift+P > "New Cursor Rule"
# Name it, write the instructions, pick the rule type

Cmd/Ctrl+Shift+P > "Reindex"
# When Agent does not find files it should

Cmd/Ctrl+Shift+P > "Delete Old Chats", then "GC Agent KV Blobs"
# Frees disk space used by old Agent chats
💡 The palette is searchable: type part of a command name
⚡ Cmd/Ctrl+Shift+J opens Cursor Settings; Cmd/Ctrl+, opens general settings
🔍 Cmd/Ctrl+R then Cmd/Ctrl+S opens Keyboard Shortcuts
📌 In the Agents Window, Cmd/Ctrl+K opens its own command palette
commandspaletteshortcuts

Chat Modes

Different conversation modes for specific tasks

yaml
# Built-in modes (mode picker in the Agent panel)
Agent              # Edits files and runs commands
Ask                # Read-only questions
Plan               # Reviewable plan, then Build
Debug              # Runtime evidence, then a targeted fix

# Switch modes
Shift+Tab          # Rotate between modes
Cmd/Ctrl+.         # Mode menu

# Custom Modes: a skill kept on for the whole session
/                  # Open the menu and pick a skill
Enter              # Use the skill for one message
Opt/Alt+Enter      # Use it as a Custom Mode (or choose Use as Mode)
yaml
# .cursor/skills/code-review/SKILL.md
---
name: code-review
description: Review code for bugs, security issues and improvements.
icon: shield
color: blue
---
Check input validation, error handling and missing tests.

# Use it as a mode
# Type /, pick code-review, press Opt/Alt+Enter
# The badge stays in the chat input until you exit the mode
💡 Plans save to your home directory; Save to workspace moves one into the repo
⚡ A Custom Mode keeps the skill in context on every turn until you exit it
🔍 Custom Modes work in the Agents Window and the CLI
📌 The icon and color frontmatter fields style the mode's badge
modescustomchat

Integrations

Connect with external tools

bash
# Cloud Agent integrations
# Connect at cursor.com/dashboard > Integrations
GitHub         # @cursor on a PR or issue starts a Cloud Agent
Slack          # @Cursor <prompt> in a channel
Linear         # Delegate an issue to Cursor, or @Cursor in a comment
Bugbot         # Automatic pull request review

# Bugbot on a pull request
cursor review                # Comment to trigger a review (or: bugbot run)
cursor review verbose=true   # Also list the rules it used
.cursor/BUGBOT.md            # Project-specific review guidelines

# MCP servers: tools and data for Agent
.cursor/mcp.json             # Project servers
~/.cursor/mcp.json           # Global servers
Customize (sidebar)          # Browse, add and toggle servers

# Deeplinks: share a prompt, command or rule
cursor://anysphere.cursor-deeplink/prompt?text=<text>
https://cursor.com/link/prompt?text=<text>
bash
# Example: .cursor/mcp.json
{
  "mcpServers": {
    "docs": {
      "command": "npx",
      "args": ["-y", "mcp-server"],
      "env": { "API_KEY": "${env:API_KEY}" }
    },
    "kb": {
      "url": "https://api.example.com/mcp",
      "headers": { "Authorization": "Bearer ${env:MY_SERVICE_TOKEN}" }
    }
  }
}

# Example: Bugbot
1. Connect your repository provider in the dashboard
2. Open a pull request
3. Bugbot comments with bugs and suggested fixes
💡 Slack and Linear start Cloud Agents; they are not notification feeds
⚡ Bugbot runs on every PR update and leaves inline comments
🔍 Bugbot reads .cursor/BUGBOT.md, not your project rules
📌 A deeplink only prefills a prompt, command or rule; the user must confirm it
integrationsgithubslack

Tips & Best Practices

Get the most out of Cursor

Optimize AI understanding

bash
# Best practices

1. Mention the files you mean
   @auth.service.ts, not "the auth file"

2. Include the error
   Paste the message or stack trace, or use @Terminals

3. Write project rules
   .cursor/rules/*.mdc for patterns Agent should always follow

4. Plan before big changes
   Shift+Tab to Plan mode for work that touches many files

5. Start a new chat for a new task
   Cmd/Ctrl+N when you finish a feature or switch tasks

6. Watch the context ring
   Click it to see what fills the context window
bash
# GOOD: specific context
@user.model.ts @auth.service.ts
"Add password reset with email verification"

# BAD: vague
"Fix the login"

# GOOD: include the error
[paste the TypeError stack trace]
"Fix this type error"

# Side question without derailing the main chat
/side how does the token refresh work?
💡 Specific prompts with expected behavior and constraints get better results
⚡ Rules keep Agent consistent without repeating yourself
🔍 When the window fills up, Cursor summarizes older parts of the conversation
📌 A side chat (/side or /btw) answers a tangent and keeps the main thread clean
tipscontextbest-practices

Keep Cursor running smoothly

bash
# Performance tips

1. Find a slow extension
   cursor --disable-extensions
   Then re-enable extensions one at a time

2. Ignore large generated folders
   Add dist/, build/ and .next/ to .cursorignore

3. Turn Tab off where you do not need it
   Tab indicator (bottom right): snooze, or disable per file extension

4. Free disk space used by old chats
   Cmd/Ctrl+Shift+P > "Delete Old Chats", then "GC Agent KV Blobs"

5. See what each extension costs
   Cmd/Ctrl+Shift+P > "Show Running Extensions"
bash
# .cursorignore (same syntax as .gitignore)
dist/
build/
.next/
*.min.js
**/logs
!app/            # Negate: do not ignore

# Already ignored by default:
# .gitignore entries, .env*, .git/, node_modules/, lock files
💡 High CPU or memory use usually comes from extensions or settings
⚡ .cursorignore keeps files away from Agent, Tab and @ mentions
🔍 Terminal commands and MCP tools can still read ignored files
📌 Privacy Mode is about training, not speed: use .cursorignore to hide files
performanceoptimizationtips

Quick fixes for common problems

bash
# Common issues and fixes

"Tab suggestions not appearing"
- Plan limit reached (free plans have a Tab allowance)
- Network blocks HTTP/2: Cursor Settings > Network > HTTP Compatibility Mode
- Old version: Cmd/Ctrl+Shift+P > "Cursor: Attempt Update"

"Agent does not see my files"
- Check .cursorignore and .gitignore
- Cmd/Ctrl+Shift+P > "Reindex"
- Attach the file with @

"A rule is not applied"
- The file must end in .mdc
- Apply Intelligently needs a description
- Apply to Specific Files needs a pattern that matches

"Agent went the wrong way"
- Cmd/Ctrl+Shift+Backspace or the Stop button
- Restore Checkpoint on an earlier message

"Cursor is slow"
- cursor --disable-extensions
- Add generated folders to .cursorignore
bash
# Report a bad response
1. Open the three-dot menu at the bottom of the response
2. Choose Copy Request ID
3. Post on forum.cursor.com with the ID, the steps to
   reproduce, your OS and your Cursor version

# Look for errors
Help > Toggle Developer Tools              # Console errors
Cmd/Ctrl+Shift+P > "Developer: Export Logs"

# MCP server problems
Output panel > MCP Logs
💡 Copy the Request ID before you report: support finds the request with it
⚡ Cursor version: Cursor > About Cursor on macOS, Help > About on Windows and Linux
🔍 With Privacy Mode on, support sees very little of a request
📌 Report bugs on forum.cursor.com
troubleshootingdebugfixes