ref

Appendix B

Appendix B

Keyboard shortcuts, @ references, and rules templates.

Appendix B: Cursor Quick Reference


Keyboard Shortcuts

ActionMacWindows/Linux
Open chatCmd + LCtrl + L
Inline editCmd + KCtrl + K
Accept changeCmd + EnterCtrl + Enter
Reject changeCmd + BackspaceCtrl + Backspace
Toggle Agent/AskClick dropdownClick dropdown

@ Reference Types

ReferenceSyntaxUse When
Specific file@file path/to/file.tsYou know which file to include
Folder@folder src/componentsWorking across related files
Codebase@codebaseNot sure where something is
Documentation@docs ReactFramework/library questions
Web search@webNeed current information
Git history@gitUnderstanding recent changes
Symbol@symbol functionNameReference a specific function/class

Recommended Global Rules

Copy this to Settings → Cursor Settings → Rules:

- Be concise. Give the answer immediately without restating the question. - Treat me as an expert programmer unless I ask for explanation. - Be accurate and thorough. - If making an educated guess, say so explicitly. - If you need more context to answer well, ask. - For code changes, show just the changed lines with a few lines of context. - Don't add unnecessary comments to code. - Follow existing patterns in the codebase.

Project Rules Template

Create .cursor/rules/project.mdc in your project root:

# Project Rules for [Project Name] ## Tech Stack - Language: [e.g., TypeScript 5.0] - Framework: [e.g., Next.js 14] - Database: [e.g., PostgreSQL with Prisma] - Testing: [e.g., Jest + React Testing Library] ## Code Style - [e.g., Use functional components with hooks] - [e.g., Prefer named exports over default exports] - [e.g., Use absolute imports from @/] ## Patterns to Follow - [e.g., API routes go in /app/api/] - [e.g., Use Zod for validation] - [e.g., Error handling follows existing patterns in lib/errors.ts] ## Patterns to Avoid - [e.g., Don't use any type - always type properly] - [e.g., Don't use class components] - [e.g., Don't install new dependencies without asking]

YOLO Mode Safety Checklist

Before enabling auto-run mode:

  • I'm using version control (Git)
  • I've committed my current work
  • I've set up an allowlist OR denylist
  • Production credentials are NOT in my environment

//Recommended Allowlist

npm test npm run lint npm run build npm run dev yarn test yarn lint yarn build pytest python -m pytest rails test bundle exec rspec cargo test go test

//Recommended Denylist

rm mv kill sudo chmod chown DROP DELETE TRUNCATE curl wget ssh scp

Agent Mode vs Ask Mode

FeatureAgent ModeAsk Mode
Can edit filesYesNo
Can run commandsYesNo
Can read filesYesYes
Can search codebaseYesYes
Best forImplementing featuresQuick questions

Default to Agent mode for anything that involves writing code.


Troubleshooting

//"Cursor isn't seeing my files"

  1. Check if the file is in .gitignore or .cursorignore
  2. Try using explicit @file reference
  3. Check if the file is too large (>1MB may cause issues)

//"Changes aren't what I wanted"

  1. Be more specific in your prompt
  2. Include more context with @ references
  3. Start a fresh chat
  4. Break the task into smaller steps

//"Agent is stuck"

  1. Press Stop
  2. Start a new chat
  3. Give clearer, more specific instructions
  4. Break the task into smaller steps