Cursor has emerged as the leading AI-first integrated development environment (IDE) for software engineers. By forking VS Code, Cursor integrates large language models directly into the editor’s UI—bringing inline edits, multi-file code generation (Composer), and automated debugging directly into your daily workspace. As developers, mastering these hotkeys and context references is essential for maximizing velocity.
Below is the complete, fact-checked cheat sheet and workflow guide for the Cursor AI editor.
Key Takeaways
- Cursor is an AI-first IDE built on VS Code with native inline edit (Cmd+K), chat (Cmd+L), and Composer (Cmd+I).
- Attach precise context using @Files, @Folders, @Docs, and @Git inside AI prompts.
- Define custom project-wide instructions in .cursor/rules (or .cursorrules).
- Multi-file code generation and repository refactoring powered by Cursor Agent mode.
- 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+I) handles multi-file changes, new features, and refactors across your codebase - Debugger integration generates step-by-step debugging plans from stack traces
What Are the Core Cursor Keyboard Shortcuts and Setup Steps?
The core Cursor keyboard shortcuts are Cmd+K (Ctrl+K) for inline AI editing, Cmd+L (Ctrl+L) for codebase chat, Cmd+I (Ctrl+I) to open Composer, and Tab to accept inline completions. Setting up Cursor involves downloading the client, logging in to sync your subscription or custom keys, and configuring keybindings to match your previous workspace.
Below is the quick-reference layout for installation and core shortcuts:
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 (Mac) | Shortcut (Windows/Linux) | What it does |
|---|---|---|---|
| Open Chat | Cmd+L | Ctrl+L | Open AI chat panel (side or full) |
| Inline Edit | Cmd+K | Ctrl+K | Edit selected code with AI |
| Open Composer | Cmd+I | Ctrl+I | Launch multi-file editing panel |
| Accept completion | Tab | Tab | Accept Cursor Tab suggestion |
| Reject completion | Esc | Esc | Reject and write normally |
| Next suggestion | Alt+] | Alt+] | Cycle to next Tab suggestion |
| Prev suggestion | Alt+[ | Alt+[ | Cycle to previous Tab suggestion |
| Quick ask | Cmd+Enter | Ctrl+Enter | Ask about selected code |
| Generate file | Cmd+Shift+K | Ctrl+Shift+K | Generate new file from prompt |
| Cmd+P palette | Cmd+P | Ctrl+P | Quick file open (standard VS Code) |
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:5Inline 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 |
How Do You Write Effective Rules for AI in Cursor?
You write effective rules for AI in Cursor by placing custom guidelines in a .cursorrules file or creating markdown files within a .cursor/rules/ directory in the root of your project. These rules tell the AI how to style code, write tests, handle exceptions, and structure folder assets automatically.
Here are standard templates for project-specific rules:
# .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`How Do You Automate Coding in Composer?
You automate coding in Composer by opening the panel with Cmd+I (Ctrl+I) and typing instructions using slash commands like /compose or /fix to perform multi-file modifications and code generation. Unlike standard chat panels, Composer operates on multiple files simultaneously, editing imports and generating directories as needed.
Here are three common patterns for Composer workflows:
1. 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 styles2. 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 tests3. Debug a stack trace
/fix
[Error stack trace here]
The error happens in src/middleware/auth.ts at line 47.
Fix it and explain what caused it.How Do You Integrate Cursor with Your Local Debugger?
You integrate Cursor with your local debugger by copying error stack traces directly into Composer, typing /fix, and letting the AI trace the error flow across your codebase. For traditional step-by-step debugging, you can use VS Code’s standard launch configurations and hotkeys to control breakpoints.
For breakpoint and step-through debugging:
F5— Start debugger (standard VS Code config)F9— Toggle breakpoint on current lineF10— Step over active statementF11— Step into function callShift+F11— Step out of active function
Which AI Models Work Best for Cursor Tasks?
The AI models that work best for Cursor tasks are Claude 3.5 Sonnet for complex refactoring and reasoning, and Cursor Spark for rapid inline Tab completions. You can configure your default models by navigating to the Cursor settings panel.
Below is the model selection guidelines:
| Model | Best for | Cost Profile |
|---|---|---|
| Cursor Spark (default) | Fast Tab completions, simple syntax edits | Low latency, free |
| Claude 3.5 Sonnet | Complex reasoning, architecture, Composer | Premium, high accuracy |
| GPT-4o | Quick explanations, simple code fixes | Fast, general accuracy |
| Gemini 1.5 Pro | Long-context analysis, codebase audits | Massive token window |
What Are the Best Practices for Cursor AI Prompting?
The best practices for Cursor AI prompting are to write specific, outcome-driven instructions instead of general commands, and to attach precise codebase contexts using @ symbols. This prevents the AI from hallucinating imports or modifying unrelated files.
Here is a comparison of bad vs. good prompting techniques:
- Avoid Vague Requests: Instead of prompting “Fix the login bug,” write “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.”
- Attach Target Context: Do not just write “Fix the auth bug.” Instead, use references: “@file:src/middleware/auth.ts @file:src/app/login/page.tsx The auth middleware is rejecting valid tokens on Vercel deployment but works locally. Fix the redirect logic.”
Frequently Asked Questions
How does Cursor differ from GitHub Copilot?
Cursor is an independent editor fork of VS Code with AI built into its core UI (Composer, Inline Edit, Chat), whereas Copilot is an extension running inside a separate editor host. Cursor’s Composer can make multi-file changes in one pass, while Copilot primarily fills individual completions.
Can I use my own API key in Cursor?
Yes, you can use your own keys by navigating to Cmd+, → Models → Add custom model and entering your API credentials for OpenAI, Anthropic, or Google.
Does Cursor work with JetBrains IDEs?
No, Cursor is a dedicated fork of VS Code. For JetBrains IDEs, you must use native integrations or separate plugins like Junie or Codeium.
How do I stop Cursor from suggesting code I do not want?
Use Esc to reject individual suggestions. For persistent suppression, add target directories to a .cursorignore file or adjust your autocomplete parameters in the Cursor settings panel.
Can Cursor access the internet?
Not by default. You must explicitly attach documentation URLs using @docs:url or use @search:query to query local files.
Is Cursor free to use?
Cursor offers a free tier with limited monthly Composer runs. The Pro subscription costs $20/month for unlimited completions and advanced model access.
What to Read Next
If you’re looking for more ways to occupy your screen time, optimize your setup, or keep your digital life secure, check out these guides:
- Master keyboard shortcuts with our VS Code Shortcuts Cheat Sheet.
- Keep your repositories organized with our complete Git Cheat Sheet.
- Optimize your development workflows using our guide on GitHub Actions Cheat Sheet.



