安装与配置
本指南将帮助你快速安装和配置 Cursor,包括从 VS Code 迁移的步骤。
#系统要求
| 系统 | 最低要求 |
|---|---|
| macOS | 10.15 (Catalina) 或更高 |
| Windows | Windows 10 或更高 |
| Linux | Ubuntu 18.04 或同等发行版 |
| 内存 | 8GB RAM (推荐 16GB) |
| 存储 | 500MB 可用空间 |
#下载安装
#macOS
- 访问 cursor.com↗
- 点击 "Download for Mac"
- 打开下载的
.dmg文件 - 将 Cursor 拖入 Applications 文件夹
bash# 或使用 Homebrew 安装 brew install --cask cursor
#Windows
- 访问 cursor.com↗
- 点击 "Download for Windows"
- 运行下载的安装程序
- 按提示完成安装
#Linux
bash# AppImage 方式 chmod +x cursor-*.AppImage ./cursor-*.AppImage # 或添加到 PATH sudo mv cursor-*.AppImage /usr/local/bin/cursor
#从 VS Code 迁移
Cursor 支持一键导入 VS Code 配置:
- 首次启动 Cursor
- 选择 "Import VS Code Settings"
- 等待导入完成
导入的内容包括:
- 插件/扩展
- 主题和字体设置
- 快捷键配置
- 用户设置
#账号登录
#免费账号
- 点击左下角头像图标
- 选择 "Sign In"
- 使用 GitHub 或 Google 账号登录
免费额度:
- 每月 2000 次慢速请求 (GPT-4)
- 50 次快速请求
- 无限次 GPT-3.5 请求
#Pro 账号 ($20/月)
升级 Pro 可获得:
- 无限次快速请求
- 优先响应速度
- 更长的上下文窗口
- Claude 模型访问权限
#基础配置
#选择 AI 模型
打开设置 (Cmd+,),找到 "Models" 部分:
json{ "cursor.chat.model": "gpt-4", "cursor.composer.model": "claude-3.5-sonnet", "cursor.autocomplete.model": "cursor-small" }
推荐配置:
- Chat:
gpt-4或claude-3.5-sonnet - Composer:
claude-3.5-sonnet(代码能力强) - Tab 补全:
cursor-small(快速响应)
#配置 .cursorrules
在项目根目录创建 .cursorrules 文件,自定义 AI 行为:
markdown# Project Rules ## Tech Stack - React 18 with TypeScript - Next.js 14 App Router - Tailwind CSS - Prisma ORM ## Code Style - Use functional components with hooks - Prefer named exports - Use TypeScript strict mode - Follow Airbnb style guide ## AI Instructions - Always add TypeScript types - Include error handling - Write unit tests for new functions - Use English comments
#常用设置
json{ // 启用 Tab 补全 "cursor.autocomplete.enabled": true, // 补全延迟 (毫秒) "cursor.autocomplete.delay": 100, // 自动接受补全 "cursor.autocomplete.autoAccept": false, // Chat 历史保存 "cursor.chat.saveHistory": true }
#常见问题
#无法登录
- 检查网络连接
- 尝试使用代理
- 清除 Cursor 缓存:
- macOS:
~/Library/Application Support/Cursor - Windows:
%APPDATA%/Cursor
- macOS:
#AI 响应慢
- 检查是否用尽免费额度
- 尝试切换到较小的模型
- 考虑升级 Pro 账号
#插件不工作
某些 VS Code 插件可能与 Cursor 不完全兼容:
- 尝试更新插件版本
- 查看 Cursor 的已知问题列表
- 考虑使用替代插件
#下一步
- 第一个项目 - 用 Cursor 创建第一个项目
- AI Chat 对话 - 学习 Chat 功能