Cursor AI Editor Complete Installation Guide: VS Code Migration & .cursorrules Project Setup
Cursor AI Editor Complete Installation Guide
Cursor is an AI-powered code editor built on VS Code that supercharges your development workflow with integrated AI assistance. This guide walks you through installation, migrating your VS Code settings, and configuring project-specific AI rules with .cursorrules.
Step 1: Download and Install Cursor
- Visit cursor.com and download the installer for your operating system (Windows, macOS, or Linux).- Run the installer:
- Windows: Execute
CursorSetup.exeand follow the prompts.- macOS: Open the.dmgfile, drag Cursor to Applications.- Linux: Use the AppImage or install via the provided.debpackage:
# Linux .deb installation
sudo dpkg -i cursor_*.deb
sudo apt-get install -f
Or AppImage
chmod +x cursor-.AppImage
./cursor-.AppImage- Launch Cursor. On first run, you will be prompted to sign in or create an account.- Choose your plan (Free tier includes limited AI queries; Pro unlocks unlimited fast requests).
Step 2: Migrate Your VS Code Settings
Cursor provides a built-in migration tool that imports your extensions, keybindings, settings, and themes from VS Code automatically.
- Open Cursor and navigate to **File → Preferences → Cursor Settings** (or press Ctrl+Shift+J / Cmd+Shift+J).- Under the **General** tab, find **"VS Code Import"** and click **"Import from VS Code"**.- Cursor will detect your existing VS Code profile and import:
settings.json preferences- keybindings.json custom shortcuts- Snippets and themes# macOS / Linux
cp -r ~/.vscode/extensions ~/.cursor/extensions
cp ~/Library/Application\ Support/Code/User/settings.json ~/Library/Application\ Support/Cursor/User/settings.json
cp ~/Library/Application\ Support/Code/User/keybindings.json ~/Library/Application\ Support/Cursor/User/keybindings.json
Windows (PowerShell)
Copy-Item -Recurse “$env:USERPROFILE.vscode\extensions” “$env:USERPROFILE.cursor\extensions”
Copy-Item “$env:APPDATA\Code\User\settings.json” “$env:APPDATA\Cursor\User\settings.json”
Copy-Item “$env:APPDATA\Code\User\keybindings.json” “$env:APPDATA\Cursor\User\keybindings.json”
Restart Cursor after manual migration to load all extensions and settings.
Step 3: Configure AI Model Settings
Cursor supports multiple AI models. Configure your preferred model for different tasks:
- Open Cursor Settings (
Ctrl+Shift+J).- Navigate to the Models tab.- Select your default model for Chat, Composer, and Tab completion.- If using a custom API key, enter it under OpenAI API Key:# In Cursor Settings → Models → OpenAI API Key YOUR_API_KEYYou can also configure Azure OpenAI or Anthropic API endpoints for enterprise setups.
Step 4: Set Up .cursorrules for Project-Specific AI Rules
The .cursorrules file lets you define project-specific instructions that the AI follows whenever it generates or edits code in your repository. Place it at your project root.
Creating Your .cursorrules File
# In your project root
touch .cursorrules
Example: Full-Stack Web Project
# .cursorrules
You are an expert full-stack developer working on a Next.js 14 application.
## Tech Stack
- Framework: Next.js 14 with App Router
- Language: TypeScript (strict mode)
- Styling: Tailwind CSS v3
- Database: PostgreSQL with Prisma ORM
- Auth: NextAuth.js v5
- Testing: Vitest + Testing Library
## Code Style Rules
- Use functional components with arrow functions
- Prefer server components; mark client components with "use client" only when needed
- Use named exports, not default exports
- All functions must have explicit TypeScript return types
- Use path aliases: @/components, @/lib, @/utils
## File Naming
- Components: PascalCase (e.g., UserProfile.tsx)
- Utilities: camelCase (e.g., formatDate.ts)
- API routes: route.ts inside descriptive folders
## Error Handling
- Always use try-catch in async functions
- Return typed error responses from API routes
- Log errors with structured format using the project logger
## Security
- Never expose API keys in client-side code
- Validate all user input with Zod schemas
- Use parameterized queries only
Example: Python Data Science Project
# .cursorrules
You are a senior data scientist working on a Python ML pipeline.
## Environment
- Python 3.11+
- Package manager: Poetry
- Key libraries: pandas, scikit-learn, PyTorch, matplotlib
## Code Standards
- Follow PEP 8 strictly
- Use type hints for all function signatures
- Write Google-style docstrings for all public functions
- Use pathlib.Path instead of os.path
- Prefer list comprehensions over map/filter where readable
## Data Handling
- Never load full datasets into memory without checking size first
- Use chunked reading for CSVs over 100MB
- Always set random seeds for reproducibility: random_state=42
Using .cursorrules with the New Directory-Based Format
Cursor also supports a .cursor/rules/ directory for modular rule files:
your-project/
├── .cursor/
│ └── rules/
│ ├── general.mdc
│ ├── frontend.mdc
│ └── testing.mdc
├── src/
└── package.json
Each .mdc file can target specific file patterns:
---
description: Frontend component rules
globs: src/components/**/*.tsx
alwaysApply: false
---
- Use Tailwind CSS for all styling
- Ensure all components are accessible (ARIA labels, keyboard navigation)
Write unit tests for every new component
Step 5: Essential Keyboard Shortcuts
| Action | Windows/Linux | macOS |
|---|---|---|
| Open AI Chat | Ctrl+L | Cmd+L |
| Inline Edit (Quick Fix) | Ctrl+K | Cmd+K |
| Open Composer | Ctrl+I | Cmd+I |
| Accept AI Suggestion | Tab | Tab |
| Reject AI Suggestion | Esc | Esc |
| Toggle AI Panel | Ctrl+Shift+L | Cmd+Shift+L |
| Cursor Settings | Ctrl+Shift+J | Cmd+Shift+J |
@filename, documentation with @Docs, or codebase-wide context with @Codebase to give the AI precise context.- **Composer for multi-file edits:** Use Ctrl+I to open Composer mode, which can create and modify multiple files in a single operation — ideal for scaffolding features.- **Pin frequently-used docs:** Go to **Cursor Settings → Features → Docs** and add documentation URLs (e.g., framework docs) so the AI references the latest API surface.- **Git-aware rules:** Add .cursorrules to version control so your entire team benefits from consistent AI behavior across the project.- **Leverage .cursor/rules with globs:** Create separate rule files per domain (backend, frontend, tests) so the AI automatically applies the right context based on which file you are editing.- **Privacy mode:** Enable **Privacy Mode** in Cursor Settings to ensure your code is never stored on remote servers — critical for proprietary codebases.
## Troubleshooting Common Issues
| Problem | Solution |
|---|---|
| Extensions not loading after migration | Run cursor --install-extension from the terminal, or reinstall from the Extensions panel. Some VS Code extensions may not be compatible. |
| AI responses are slow or timing out | Check your internet connection. If using a custom API key, verify your quota and billing at the provider dashboard. Switch to a faster model in settings. |
| .cursorrules not being picked up | Ensure the file is in the project root (same level as package.json or .git). Restart Cursor after creating the file. Check for typos in the filename. |
| High memory usage | Disable unused extensions. Cursor inherits VS Code's extension model, so large extension sets can consume significant RAM. |
| Keybinding conflicts | Open **Keyboard Shortcuts** (Ctrl+K Ctrl+S) and search for conflicting bindings. Cursor's AI shortcuts may overlap with existing VS Code bindings. |
Can I use Cursor and VS Code side by side?
Yes. Cursor runs as a completely separate application with its own configuration directory. You can have both installed and use them simultaneously. They share no runtime state, though you can import settings from VS Code into Cursor at any time using the built-in migration tool.
Does .cursorrules work with all AI models in Cursor?
Yes, .cursorrules instructions are injected into the system prompt regardless of which model you select (GPT-4, Claude, or others). The AI will follow your project rules across Chat, Composer, and inline editing modes. Note that more complex rule sets perform better with advanced models.
Is my code sent to external servers when using Cursor?
By default, Cursor sends code context to AI model providers for processing. However, you can enable Privacy Mode in Cursor Settings, which ensures your code is not stored or used for training. For enterprise deployments, Cursor offers a self-hosted option and supports routing requests through your own API keys so that data never leaves your infrastructure.