Cursor

Use Cursor to understand a repository, make a scoped change, and check the result. Shortcuts below refer to the macOS editor and may vary by configuration.

Keyboard Shortcuts

Open Agent (editor)Cmd + I
Open ChatCmd + L
Inline EditCmd + K
Add selection to ChatCmd + Shift + L
Accept completionTab
Cancel/dismissEscape
Submit in chatCmd + Enter
Toggle sidebarCmd + /

Workflows

Agent for changes across files

Use Agent for changes across files. Describe the result, point to relevant code, and ask it to run the project’s checks.

  1. 1Open Agent in Cursor
  2. 2Describe the change: 'Add user authentication to the API routes'
  3. 3Review the proposed changes across files
  4. 4Apply all or selectively accept changes

Chat for Exploration

Use Chat (Cmd+L) when you need to understand code, explore options, or get explanations before making changes.

  1. 1Select code and open Chat with Cmd+L
  2. 2Ask questions: 'How does this function handle errors?'
  3. 3Confirm your understanding before asking Agent to edit

Inline Edit for Quick Fixes

Use Cmd+K for small, targeted changes within a single file. Review the resulting diff before keeping it.

  1. 1Select the code to modify
  2. 2Press Cmd+K
  3. 3Describe the change: 'Add null check'
  4. 4Accept or reject the inline change

@ Mentions for Context

Reference specific files, functions, or docs with @ mentions to give Cursor precise context.

  1. 1Type @ in the prompt to choose context
  2. 2Attach the files or documentation relevant to the task
  3. 3Ask questions with explicit context

Codebase-Wide Questions

Ask questions about your entire codebase using the indexed context. Great for understanding unfamiliar code.

  1. 1Ensure codebase is indexed (check settings)
  2. 2Ask broad questions: 'Where is user authentication handled?'
  3. 3Follow up with specific file references

Tips

Use project rules

Store project rules in .cursor/rules. Set their scope and keep them current. Cursor also supports AGENTS.md; .cursorrules is the legacy format.

// Example rule content
Use TypeScript strict mode
Prefer functional components with hooks
Use Tailwind for styling
Follow the patterns in /lib/utils

Index Your Codebase

Check codebase indexing in Cursor settings. Confirm that the files needed for the task are available and that private files are excluded as intended.

Be Specific About Files

Instead of 'update the auth', say 'update the auth logic in @lib/auth.ts to add refresh token support'.

Review Before Applying

Review Agent changes in the diff view. Run the relevant checks before merging.

Use Tab for Completions

Cursor's tab completions are context-aware. Let it suggest code as you type, especially for boilerplate.

Escape to Cancel

Stop a generation when the approach is wrong. Clarify the task before continuing.

Reference Documentation

Attach official documentation for the version used by your project. Ask the agent to check it before changing an unfamiliar API.

Split Complex Tasks

Break large changes into smaller Agent requests. 'First, create the types. Then, implement the API route.'

For current features and controls, see the official documentation.