- Cursor is a VS Code fork with AI natively built in — composer, inline edits, chat, and autocomplete all in one editor
- Tab (
Tab) accepts AI completions inline;Cmd+K(Ctrl+K) opens inline edit mode @references attach context (files, folders, docs, symbols) to any AI prompt- Rules for AI (
Cmd+L→ settings → Rules) set per-project behavior and conventions - Composer (
Cmd+L) handles multi-file changes, new features, and refactors across your codebase - Debugger integration generates step-by-step debugging plans from stack traces
Quick reference tables
Installation & setup
| Task | Command / Action |
|---|---|
| Download | cursor.com → Download (macOS, Windows, Linux) |
| Sign in | Cmd+, → Accounts → Sign in with GitHub |
| Update | Auto-updates in the background |
| Check version | Cmd+, → Cursor Health |
| Reset usage | Cmd+, → Account → Reset usage |
Core AI commands
| Action | Shortcut | What it does |
|---|---|---|
| Open Chat | Cmd+L | Open AI chat panel (side or full) |
| Inline Edit | Cmd+K | Edit selected code with AI |
| Accept completion | Tab | Accept Cursor Tab suggestion |
| Reject completion | Esc | Reject and write normally |
| Next suggestion | Alt+] | Cycle to next Tab suggestion |
| Prev suggestion | Alt+[ | Cycle to previous Tab suggestion |
| Quick ask | Cmd+Enter | Ask about selected code |
| Generate file | Cmd+Shift+K | Generate new file from prompt |
| Cmd+P palette | Cmd+P | Quick file open (standard VS Code) |
Composer (Cmd+L → New Tab)
The Composer tab handles complex multi-file changes:
| Action | What it does |
|---|---|
Type /compose in chat | Opens Composer mode |
| Describe feature | AI writes code across multiple files |
Type /fix | Diagnose and fix errors in Composer |
Type /explain | Explain how a feature or flow works |
Type /test | Generate tests for selected code |
Cmd+Enter | Apply Composer changes (create + open files) |
Cmd+\ | Toggle Composer in sidebar vs full pane |
Context references (@)
Attach files, folders, docs, or symbols to any prompt:
| Syntax | What it attaches |
|---|---|
@file:path/to/file | Single file contents |
@folder:path/to/folder | Entire folder (all files) |
@docs:url | Web documentation URL |
@git:message | Recent commits |
@search:query | Code search results |
@symbols:name | Symbols matching name |
@clipboard | Current clipboard contents |
@problems | Current lint/problem panel |
# Example: explain a file with its test and recent commits
@file:src/auth/login.ts @file:src/auth/login.test.ts @git:5 Inline edit workflow
- Select code or place cursor where you want changes
- Press
Cmd+K→ type your instruction - Cursor shows a diff preview (highlighted in red/green)
- Press
Tabto accept,Escto reject - Press
Cmd+Zto undo the AI change
Tab autocomplete settings
Cmd+, → Cursor → Tab → Configure behavior:
| Setting | Options |
|---|---|
| Enable Tab | Toggle on/off |
| Tab insert mode | ”Replace suggestion” or “Insert at cursor” |
| Gibbs model | Model used for Tab completions |
| Max distance | How far back Cursor looks for context |
Rules for AI (Project Instructions)
Project-level instructions that tell Cursor how to behave:
Cmd+L → settings (top-right gear) → Rules → Add Rule
Or create .cursor/rules/ directory with .md files:
# .cursor/rules/typescript.md
- Always use explicit return types on exported functions
- Prefer `interface` over `type` for object shapes
- Use Zod for runtime validation of external data
- No `any` — use `unknown` + type narrowing # .cursor/rules/project.md
- Project uses Next.js App Router
- API routes go in `src/app/api/`
- Server Components by default, Client Components use "use client"
- Use Tailwind for all styling
- Environment variables in `.env.local` Apply rules per folder using .cursor/rules/ or globally via Cmd+, → Rules.
Composer workflows
Write a new feature
/compose
Create a new feature for user notifications:
- Create src/services/notification.ts with send() and schedule() functions
- Add notification API route at src/app/api/notifications/route.ts
- Create a React hook useNotifications in src/hooks/useNotifications.ts
- Add unit tests in src/services/notification.test.ts
- Update src/app/globals.css with notification styles Refactor a module
/compose
Refactor src/database/queries.ts:
- Convert to use Drizzle ORM patterns
- Add connection pooling
- Move raw SQL to separate migration files
- Keep the same public API (exported functions)
- Preserve all existing tests Debug a stack trace
Paste the full error stack trace into Composer:
/fix
[Error stack trace here]
The error happens in src/middleware/auth.ts at line 47.
Fix it and explain what caused it. Debugger integration
Cursor reads your stack traces and generates debugging plans:
- Run your code until it throws an error
- Copy the full stack trace from the terminal
- Open Composer (
Cmd+L→ New Tab) - Paste the stack trace and type
/fix - Cursor analyzes the trace and suggests:
- The exact line causing the error
- What the expected vs actual values are
- A corrected version of the problematic code
- An explanation of the root cause
For breakpoints and step-through debugging:
F5— Start debugger (standard VS Code)F9— Toggle breakpointF10— Step overF11— Step intoShift+F11— Step out
Model selection
Cmd+, → Models → Choose default and per-task models:
| Model | Best for |
|---|---|
| Cursor Spark (default) | Fast Tab completions, inline edits |
| Claude 4 Sonnet | Complex reasoning, architecture |
| Claude 4 Opus | Large refactors, multi-file changes |
| GPT-4.1 | Quick explanations, simple fixes |
| Gemini 2.5 Pro | Long-context analysis |
Composer and Chat can use different models. Tab completions use a separate fast model.
Best practices
Effective prompt writing
Be specific about the outcome, not just the change:
❌ "Fix the login bug"
✅ "When a user submits the login form with an invalid email,
the error message should appear inline below the email field
(not in a toast). The field border should turn red (#ef4444).
Do not change the API route or any server-side logic." Chain context with @
❌ "@fix the auth bug"
✅ "@file:src/middleware/auth.ts @file:src/app/login/page.tsx
@file:src/hooks/useAuth.ts
The auth middleware is rejecting valid tokens on Vercel
deployment but works locally. Fix it." Use Rules for consistency
- Add a
.cursor/rules/folder in project root - One file per convention (typescript.md, styling.md, api.md)
- Rules apply to all AI interactions in that project
Summary
Cmd+K— Inline AI edit;Tab— Accept completionCmd+L— Chat;Cmd+L → New Tab— Composer@symbols attach context: files, folders, docs, git history- Rules for AI enforce project conventions in every AI interaction
- Composer handles multi-file features, refactors, and debugging plans
- Tab completions are fast and local; Composer uses cloud models
FAQ
How does Cursor differ from GitHub Copilot? Cursor is a VS Code fork with AI built into every surface — inline edits, chat, composer, Tab completion, and debugger integration all in one. Copilot is an extension running inside a separate editor. Cursor’s Composer can make multi-file changes in one pass; Copilot fills individual completions.
Can I use my own API key?
Yes. Cmd+, → Models → Add custom model → enter your API key for OpenAI, Anthropic, or Google.
Does Cursor work with JetBrains IDEs? Cursor is a VS Code fork only. For JetBrains, use the native Junie AI or Codeium.
How do I stop Cursor from suggesting code I don’t want?
Use Tab with Esc to reject. For persistent suppression, add the file to .cursorignore or tighten the model in Cmd+, → Models → Tab model.
Can Cursor access the internet?
Not natively. Use @docs:url to attach specific URLs as context, or use @search:query to search your codebase only.
Is Cursor free to use? Cursor has a free tier with limited Composer uses per month. Pro is $20/month for unlimited access. Tab completions are always free.
What to read next
- VS Code Shortcuts Cheat Sheet — keyboard shortcuts that work in Cursor too
- Git Cheat Sheet — version control for your AI-edited code
- GitHub Actions Cheat Sheet — CI/CD for projects built with Cursor
Related Articles
Deepen your understanding with these curated continuations.
VS Code Shortcuts for Developers: The Complete Cheatsheet
Master VS Code keyboard shortcuts — editing, navigation, debugging, Git integration, and custom keybindings. Work faster with the editor you already use.
Ollama Cheat Sheet: Local LLMs, Models, API & Integration (2026)
Complete Ollama reference — pull and run local LLMs, API endpoints, Python/JS integration, multimodal models, model management, and GPU setup in 2026.
Qwen Coder Cheatsheet (2026 Edition): Running Local Agents
Master Alibaba's open-weights Qwen Coder models. Essential commands for Ollama integration, local execution, and private agentic workflows.