Cursor AI Cheat Sheet

Last Updated: November 21, 2025

🤖 Cursor AI

AI-powered code editor (fork of VS Code)

AI Coding

Core Features

Cmd/Ctrl + K Inline AI edit (most powerful feature)
Cmd/Ctrl + L Open AI chat sidebar
Cmd/Ctrl + I Composer (multi-file edit)
Cmd/Ctrl + Shift + L New chat (clear conversation)
Tab Accept AI autocomplete suggestion
Cmd/Ctrl + Shift + P Command palette (same as VS Code)

Cmd+K (Inline Edit)

Select Code + Cmd+K AI edit selected code
Cmd+K on Empty Line Generate new code
Prompt Examples "Add error handling", "Convert to async", "Add type hints"
Cmd+Enter Submit prompt to AI
Accept (Tab) Apply AI changes
Reject (Esc) Discard AI suggestion
Regenerate Ask AI to try again with different approach
Diff View See before/after changes inline

Chat (Cmd+L)

Ask Questions "How does this function work?", "Explain this pattern"
@file Reference specific file in chat (@app.py)
@folder Reference entire folder (@src/)
@codebase Search entire codebase for context
@docs Reference official documentation (e.g., @docs React hooks)
@web Search the web for current information
Copy Code Block Click copy icon on AI code suggestions
Insert at Cursor Apply chat code directly to editor
Chat History Access previous conversations in sidebar

Composer (Cmd+I)

Multi-File Editing Edit multiple files simultaneously
Add Files + button to add files to composer context
Complex Instructions "Refactor authentication to use JWT across auth.py and middleware.py"
Review Changes See all proposed changes before applying
Accept All / Reject All Bulk actions on composer suggestions
@codebase in Composer Let AI find relevant files automatically

Autocomplete & Suggestions

Tab Accept autocomplete (partial or full)
Cmd/Ctrl + → Accept word by word
Ghost Text Grayed-out AI suggestions as you type
Multi-Line Completions AI suggests entire functions/blocks
Context-Aware Suggestions based on entire codebase
Cmd/Ctrl + . Show quick fixes (VS Code feature)

Codebase Search

@codebase Semantic search across all files
"Find authentication logic" Natural language code search
Cmd/Ctrl + P Quick file open (standard VS Code)
Cmd/Ctrl + Shift + F Text search (standard VS Code)
Indexed Codebase AI indexes your code for fast semantic search

AI Rules (.cursorrules)

.cursorrules File Project root file with AI instructions
Coding Standards "Always use TypeScript strict mode"
Frameworks "Use Next.js App Router, not Pages Router"
Testing "Write Jest tests for all new functions"
Style Guide "Follow Airbnb style guide"
Example .cursorrules Use TypeScript. Prefer functional components. Add JSDoc comments.

Models

GPT-4 Default model; powerful but slower
GPT-4o Faster, optimized GPT-4
Claude 3.5 Sonnet Excellent for code; long context window
GPT-3.5 Fast, basic tasks
Cursor Small Fast autocomplete model
Switch Models Settings > Features > AI Model

Settings & Customization

Cursor Settings Cursor > Settings (or Cmd/Ctrl + ,)
Enable/Disable Autocomplete Features > Cursor Tab
Privacy Mode Features > Privacy Mode (no code sent to AI)
Include .gitignore Respect .gitignore for AI indexing
Custom API Keys Use own OpenAI/Anthropic keys
Usage Dashboard Account > Usage (track requests)

Common Prompts

"Add error handling" Wrap code in try-catch with proper errors
"Add TypeScript types" Convert JavaScript to TypeScript
"Refactor to use hooks" Convert class component to functional
"Add unit tests" Generate test file with common cases
"Optimize performance" Suggest performance improvements
"Add JSDoc comments" Document functions with JSDoc
"Make this responsive" Add CSS media queries

Debugging & Fixing

Select Error + Cmd+K "Fix this error"
Chat with Error Message Paste error, ask "How do I fix this?"
"Explain this error" Get human-readable explanation
Terminal Error + Cmd+L Copy error to chat for diagnosis
Pro Tips:
  • Cmd+K for Everything: Select code, Cmd+K, type intent; fastest workflow
  • Use @codebase: Let AI find relevant files instead of manual @file references
  • .cursorrules = Consistency: Define project standards once; AI follows forever
  • Composer for Refactoring: Big changes across multiple files in one shot
  • Tab for Autocomplete: Trust the ghost text; saves massive time
  • Chat for Learning: Ask "why" and "how" to understand code patterns
  • @docs for Accuracy: Reference official docs for framework-specific questions
  • Privacy Mode for Sensitive Code: Enable before opening work projects
← Back to Data Science & ML | Browse all categories | View all cheat sheets