概述
Cursor 是 Anysphere 开发的下一代 AI 代码编辑器,被广泛认为是顶级的 AI 原生 IDE。它在 VS Code 基础上深度定制,并集成最先进的 AI 模型;其核心功能 Composer 2 是一个可自主运行、并行处理多个任务的 Agent。2026 年 5 月的 3.3 更新进一步强化了 Agent 自动安装依赖、自主调试等能力,支持 Python、Java、C#、JavaScript 等主流语言。
核心特性:AI 原生编辑器、Composer agent、多任务并行、Agent 自动化。
安装
从官网下载对应平台的安装包。Cursor 支持 Windows、macOS 和 Linux。由于基于 VS Code 内核构建,安装后可一键导入你现有的 VS Code 扩展、快捷键和设置。
# Download links
# Official site: https://www.cursor.com
# Download page: https://www.cursor.com/download
# Windows: download the .exe installer and run it
# macOS: download the .dmg and drag it into Applications
# Linux: download the .AppImage or .deb
# On first launch you'll be prompted to import VS Code settings—one click to migrateCursor 提供免费档(请求受限)和 Pro 订阅(约 $20/月);更高的 Pro 档位价格更高。
基本用法
Cursor 的核心交互是 Cmd/Ctrl+K 进行内联编辑、Cmd/Ctrl+L 打开聊天面板、Composer(Cmd/Ctrl+I)用于多文件 Agent。Composer 可以一次编辑多个文件、自主运行终端命令并安装依赖,非常适合大型重构和新功能开发。
# Common shortcuts
Cmd/Ctrl + K # Inline AI edit: generate/modify selected code
Cmd/Ctrl + L # Open the chat panel to ask questions or explain code
Cmd/Ctrl + I # Launch the Composer agent (multi-file editing)
# Example Composer instruction
"Build a complete blog system with an article list, detail page, and Markdown editor"
# Reference context with @
"Based on the stack in @package.json, add a feature to export to PDF"在 Composer 中可以开启"Agent 模式",让它自主运行命令、安装依赖并修复错误。
技巧
一份精心编写的 .cursorrules 项目规则文件能让 AI 遵循你的代码规范;用 @ 引用文件、文档或网页作为上下文可显著提升生成质量;Composer 的 Agent 模式会自动运行测试和 lint,建议在干净的 Git 状态下使用以便回退。Tab 补全会根据上下文预测多行编辑——按 Tab 接受。
# Create a rules file in the project root
echo "You are a TypeScript expert. Prefer a functional style and never use any." > .cursorrules
# Reference external docs as context
"Refactor this component following the latest patterns in @https://react.dev/learn"
# Choose a model in settings
# Settings → Models → pick Claude / GPT, etc.提示:Composer Agent 模式消耗 token 很快;对于复杂任务,分步进行并频繁查看 diff。
Configuration
Cursor is configured via the Settings panel and a project-level .cursorrules file. Settings -> Models lets you pick models (Claude, GPT, etc.) and toggle Privacy Mode, which ensures your code is not used for training. A .cursorrules file in the project root defines coding conventions the agent follows. Composer's Agent mode controls whether it can run commands and install dependencies autonomously.
# Project rules (project root)
# .cursorrules
You are a TypeScript expert. Prefer a functional style and never use any.
All public functions must have JSDoc.
# Privacy mode
# Settings -> Cursor Settings -> Privacy Mode -> enable
# (code is not used for training)
# Model selection
# Settings -> Models -> pick Claude / GPT, etc.
# Composer Agent mode
# Cmd/Ctrl+I -> toggle "Agent mode" on/off
# Agent mode can run terminal commands and install dependencies
# Reference context with @
"Based on the stack in @package.json, add PDF export"Turn on Privacy Mode for sensitive codebases; keep .cursorrules concise so the agent follows it reliably.
FAQ
Common questions cover pricing tiers, BYOK, .cursorrules behavior, Privacy Mode, and model selection. Cursor offers a free tier with limited requests and a Pro subscription; Privacy Mode prevents code from being used for training. Composer Agent mode burns tokens quickly, so work in steps and review diffs.
Q: Is there a free tier?
A: Yes—Cursor has a free tier with limited requests; Pro (~$20/month)
raises the limits and adds faster models.
Q: Can I use my own API key (BYOK)?
A: Cursor primarily uses its own subscription quota; check Settings -> Models
for the current BYOK options per provider.
Q: What does .cursorrules do?
A: It is a project-level instructions file the agent reads on every task,
covering code style, conventions, and constraints.
Q: Does Cursor train on my code?
A: Enable Privacy Mode in Settings to prevent your code from being used
for training.
Q: How do I cut token costs?
A: Work in small steps, review diffs often, and avoid long autonomous
Agent loops on the most expensive models.Composer Agent mode burns through tokens quickly; review the diff frequently.
Ready to try Cursor?
Visit the official site for the latest version and full documentation.
Visit Cursor