← All Cheat Sheets
CHEAT SHEET
Cursor
The AI code editor. Your entire codebase, understood.
Essential Keyboard Shortcuts
- •Cmd/Ctrl + K -- inline edit (select code first)
- •Cmd/Ctrl + L -- open AI chat panel
- •Cmd/Ctrl + I -- open Composer (multi-file edits)
- •Tab -- accept inline suggestion
- •Esc -- dismiss suggestion
- •Cmd/Ctrl + Shift + L -- add selection to chat context
- •@ in chat -- reference files, folders, docs, or web pages
Features That Change Everything
- •Composer -- describe a feature and Cursor edits multiple files at once
- •Codebase-aware chat -- ask questions about YOUR code, not generic code
- •@ references -- tag specific files, functions, or docs in chat
- •Auto-import -- Cursor adds missing imports automatically
- •Apply button -- one click to apply a suggested code change
- •Inline diffs -- see exactly what will change before accepting
- •.cursorrules file -- set project-specific AI behavior and conventions
Advanced Tricks
- •Use .cursorrules to define your coding standards and the AI will follow them
- •Reference docs with @docs to give the AI access to library documentation
- •Use @web to let Cursor search the internet for current API docs
- •Cmd+K on a terminal error to get an instant fix suggestion
- •Pin important files in chat context so AI always has them
Best Prompts (Copy & Use)
Add a Feature
Add [feature description] to this project. Follow the existing patterns in @[relevant file]. Make sure to handle edge cases and add error handling.
Refactor
Refactor @[filename] to [goal]. Keep the same external behavior but improve [readability/performance/type safety]. Show me the diff.
Debug
I'm getting this error: [paste error]. The relevant code is in @[filename]. Find the root cause and suggest a fix.
Write Tests
Write unit tests for @[filename] covering: happy path, edge cases, and error handling. Use [testing framework] and follow the patterns in @[existing test file].
Explain Code
Explain what @[filename] does. Focus on: 1) The main purpose 2) Key functions 3) How it connects to the rest of the codebase.
Pro Tips
Create a .cursorrules File
Add a .cursorrules file to your project root. Define your tech stack, coding conventions, preferred patterns. Cursor follows these in every suggestion.
Use Composer for Features
Don't do file-by-file edits. Open Composer (Cmd+I), describe the entire feature you want, and let it create/edit multiple files at once.
Reference Before Asking
Before asking a question, tag the relevant files with @filename. The more context you give, the better the answer.
Review Diffs Carefully
Always review the inline diff before accepting changes. Cursor is good but not perfect -- spending 10 seconds reviewing saves 10 minutes debugging.
Best For
- + Professional development
- + Multi-file refactoring
- + Codebase-wide changes
- + Feature development
- + Developers going all-in on AI coding
Not Ideal For
- - Non-developers
- - Quick one-off code questions (ChatGPT is simpler)
- - People happy with their current editor setup
Pricing
Free: 2000 completions + 50 premium requests. Pro ($20/mo): Unlimited completions + 500 premium requests. Business ($40/mo): Team features.