Cursor - Cheatsheet
Overview
Estimated time: 10โ15 minutes (reference material)
Quick reference guide for Cursor's AI-powered features, keyboard shortcuts, and productivity commands. Keep this handy for efficient AI-first development.
Tip: Pin this page as a browser bookmark for quick access while coding. Most shortcuts work across all platforms (Windows/Mac/Linux).
Essential Keyboard Shortcuts
AI Features
Cmd+K / Ctrl+K - Generate with AI
Cmd+L / Ctrl+L - Chat with AI
Cmd+I / Ctrl+I - Inline edit
Cmd+Shift+L - Chat with codebase
Cmd+Enter - Apply AI suggestion
Escape - Reject suggestion
Composer Mode
Cmd+Shift+I - Open Composer
Cmd+Enter - Run Composer task
Cmd+Shift+Enter - Apply all changes
Cmd+Shift+C - Create new Composer
Tab - Next change
Shift+Tab - Previous change
Code Navigation
Cmd+P / Ctrl+P - Quick file open
Cmd+Shift+P - Command palette
Cmd+T / Ctrl+T - Go to symbol
Cmd+G / Ctrl+G - Go to line
Cmd+Shift+O - Go to symbol in file
F12 - Go to definition
Editor Shortcuts
Cmd+/ / Ctrl+/ - Toggle comment
Cmd+D / Ctrl+D - Select next occurrence
Cmd+Shift+K - Delete line
Alt+Up/Down - Move line up/down
Cmd+Shift+D - Duplicate line
Cmd+U / Ctrl+U - Undo cursor position
AI Chat Commands
File and Code References
@ References
@filename.js - Reference specific file
@folder/ - Reference entire folder
@#symbol - Reference function/class
@selection - Reference selected code
@git - Reference git changes
@web - Search web content
Context Commands
/fix - Fix errors in selection
/edit - Edit selected code
/explain - Explain code functionality
/docs - Generate documentation
/tests - Generate tests
/optimize - Optimize performance
Common Chat Prompts
Quick Fixes:
- "Fix the TypeScript errors in this file"
- "Add error handling to this function"
- "Make this code more readable"
Code Generation:
- "Create a React component for user profiles"
- "Add API endpoints for CRUD operations"
- "Write tests for this function"
Refactoring:
- "Convert this to use async/await"
- "Extract this logic into a separate function"
- "Apply the factory pattern here"
Documentation:
- "Add JSDoc comments to all functions"
- "Create a README for this project"
- "Document the API endpoints"
Composer Workflows
Multi-File Tasks
Feature Implementation
Prompt: "Add user authentication with:
- Login/register components
- JWT token handling
- Protected route wrapper
- Auth context provider
- API integration"
Refactoring
Prompt: "Refactor the user management:
- Extract business logic to services
- Add proper TypeScript types
- Implement error boundaries
- Add loading states"
Architecture Changes
Database Migration:
"Convert from REST to GraphQL:
- Create GraphQL schema
- Add resolvers
- Update client queries
- Migrate components"
State Management:
"Replace Redux with Zustand:
- Create Zustand stores
- Update component connections
- Remove Redux boilerplate
- Test all functionality"
Advanced Features
Codebase Chat Techniques
Analysis Queries
- "What design patterns are used in this codebase?"
- "Find all API endpoints that handle user data"
- "Show me the data flow for user authentication"
- "What dependencies could be updated?"
Architecture Questions
- "How is error handling implemented?"
- "What testing strategies are used?"
- "Where is business logic located?"
- "How are environment variables managed?"
Custom Instructions
{
"rules": [
"Always use TypeScript strict mode",
"Prefer functional components with hooks",
"Use Tailwind CSS for styling",
"Follow the project's ESLint rules",
"Add JSDoc comments for public functions"
],
"preferences": {
"testing": "Jest + React Testing Library",
"stateManagement": "Zustand",
"apiClient": "Axios with interceptors"
}
}
Settings & Configuration
AI Model Settings
Model Selection
{
"cursor.ai.model": "gpt-4",
"cursor.ai.temperature": 0.1,
"cursor.ai.maxTokens": 2048,
"cursor.ai.topP": 1.0
}
Privacy Controls
{
"cursor.privacy.enableTelemetry": false,
"cursor.ai.useLocalModels": true,
"cursor.ai.enableCodebaseChat": true,
"cursor.ai.shareCodeForImprovement": false
}
Performance Optimization
{
"cursor.ai.enableInlineEditing": true,
"cursor.ai.suggestion.delay": 300,
"cursor.ai.codebaseIndexing": "smart",
"cursor.ai.cacheDuration": 3600,
"cursor.editor.suggestOnTriggerCharacters": true
}
Troubleshooting
Common Issues
Slow Suggestions
- Reduce model temperature to 0.1
- Decrease max tokens to 1024
- Clear editor cache (Cmd+Shift+P > "Clear Cache")
- Restart Cursor application
Context Issues
- Re-index codebase (Settings > AI > Reindex)
- Check file inclusion patterns
- Verify .cursorrules file syntax
- Clear conversation history
Debug Commands
Command Palette Commands:
- "Cursor: Restart AI Service"
- "Cursor: Clear AI Cache"
- "Cursor: Show AI Logs"
- "Cursor: Reindex Codebase"
- "Cursor: Reset Chat History"
Integration Tips
VS Code Extension Compatibility
Recommended Extensions
- ESLint: Code quality and style
- Prettier: Code formatting
- GitLens: Git integration
- Thunder Client: API testing
Avoid Conflicts
- Disable other AI completion tools
- Configure keybinding conflicts
- Check for duplicate functionality
- Monitor performance impact
Git Integration
Git-aware prompts:
- "Review my latest changes"
- "Generate commit message for staged changes"
- "Explain what changed in the last commit"
- "Create a pull request description"
Git references in chat:
@git:staged - Reference staged changes
@git:diff - Reference current diff
@git:branch - Reference branch changes
@git:commit - Reference specific commit
Best Practices
Effective Prompting
Clear Instructions
- Be specific about requirements
- Provide context and constraints
- Mention preferred patterns/libraries
- Include error handling needs
Context Management
- Reference relevant files with @
- Use selection for focused edits
- Clear chat history periodically
- Set up .cursorrules for consistency
Code Quality
Quality Prompts:
- "Add comprehensive error handling"
- "Include TypeScript types for all functions"
- "Add unit tests with good coverage"
- "Optimize for performance and readability"
- "Follow SOLID principles"
- "Add proper logging and monitoring"
Productivity Hacks
Custom Snippets
{
"React Functional Component": {
"prefix": "rfc",
"body": [
"interface ${1:ComponentName}Props {",
" ${2:// props}",
"}",
"",
"export const ${1:ComponentName}: React.FC<${1:ComponentName}Props> = (${3:props}) => {",
" return (",
" ",
" ${4:// component content}",
" ",
" );",
"};"
]
}
}
Template Prompts
Component Generation
"Create a [ComponentType] component:
- Name: [ComponentName]
- Props: [prop1, prop2, prop3]
- Features: [feature1, feature2]
- Styling: [Tailwind/CSS modules]
- Tests: [Jest/RTL]"
API Integration
"Add API integration for:
- Endpoint: [URL]
- Method: [GET/POST/PUT/DELETE]
- Data: [request/response structure]
- Error handling: [strategy]
- Loading states: [UI feedback]"
Team Collaboration
Shared Configuration
// .cursorrules (project root)
{
"teamStandards": {
"codeStyle": "ESLint + Prettier",
"testFramework": "Jest",
"typeChecking": "TypeScript strict",
"documentation": "JSDoc for public APIs"
},
"aiInstructions": [
"Follow the team's coding standards",
"Add tests for new functionality",
"Include error handling",
"Use existing utility functions"
]
}
Code Review Integration
Review prompts:
- "Review this code for potential issues"
- "Suggest improvements for maintainability"
- "Check for security vulnerabilities"
- "Verify error handling is comprehensive"
- "Assess performance implications"
Quick Reference Commands
File Operations
Cmd+N - New file
Cmd+O - Open file
Cmd+S - Save file
Cmd+Shift+S - Save all
Cmd+W - Close tab
Cmd+Shift+T - Reopen closed tab
Search & Replace
Cmd+F - Find in file
Cmd+Shift+F - Find in project
Cmd+H - Replace in file
Cmd+Shift+H - Replace in project
F3 / Cmd+G - Find next
Shift+F3 - Find previous
Multi-cursor
Alt+Click - Add cursor
Cmd+D - Select next match
Cmd+Shift+L - Select all matches
Alt+Shift+I - Insert cursor at line ends
Cmd+Alt+Up - Add cursor above
Cmd+Alt+Down - Add cursor below
Panel Management
Cmd+B - Toggle sidebar
Cmd+J - Toggle terminal
Cmd+Shift+E - File explorer
Cmd+Shift+G - Source control
Cmd+Shift+X - Extensions
Cmd+Shift+D - Debug panel
Next Steps
Master Cursor with these advanced resources:
- Cursor - Introduction โ Complete feature overview
- Cursor - Advanced Workflows โ Power user techniques
- AI Agents - Comparison Matrix โ Compare with other tools