cursor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCursor
Cursor
Cursor is a fork of VS Code customized for AI. It pioneered Tab-to-Complete (Copilot++) and Composer (Multi-file edits). In 2025, it is the leading "AI Native" editor.
Cursor是基于VS Code定制的AI专属编辑器,首创了**Tab-to-Complete(Copilot++)和Composer(多文件编辑)**功能。在2025年,它是领先的「AI原生」编辑器。
When to Use
使用场景
- Heavy AI Usage: If you copy-paste to ChatGPT 50 times a day, use Cursor.
- Legacy Refactoring: "Rewrite this entire legacy class to use React Hooks" works across multiple files.
- Speed: The "Shadow Workspace" indexing makes AI answers aware of full context instantly.
- 重度AI使用需求:如果你每天需要复制粘贴内容到ChatGPT多达50次,选择Cursor准没错。
- 遗留代码重构:像「将整个遗留类重写为使用React Hooks」这类需求,它可以跨多个文件完成。
- 高效速度:「Shadow Workspace」索引功能让AI能即时获取完整上下文信息,快速给出答案。
Core Concepts
核心概念
Composer (Cmd+I)
Composer(Cmd+I)
A floating window that can edit multiple files simultaneously. "Add a field to the User model and update all call sites."
verified一个可同时编辑多个文件的悬浮窗口。例如你可以输入「为User模型添加字段并更新所有调用位置」。
verifiedTab (Copilot++)
Tab(Copilot++)
Predicts your next cursor movement, not just text. It feels like mind-reading.
它能预测你下一步的光标移动,而不只是文本内容,就像读心术一样。
Indexing
索引功能
Cursor locally indexes your code (embeddings) so the LLM knows about function definitions in other files without you opening them.
Cursor会在本地对你的代码进行索引(生成嵌入向量),这样大语言模型(LLM)无需你打开其他文件,就能了解其中的函数定义。
Best Practices (2025)
2025年最佳实践
Do:
- Use Rules: Add a file to repo root to instruct the AI (e.g., "Always use Tailwind", "No try/catch blocks").
.cursorrules - Import VS Code Extensions: It takes 1 click to migrate everything from VS Code.
- Review Diffs: Cursor applies changes fast. Always review the diff (-> Accept).
Cmd+Shift+P
Don't:
- Don't sleep on Model Toggle: Switch between (Coding) and
claude-3.5-sonnet(Reasoning) depending on task.gpt-4o
建议做:
- 使用规则配置:在仓库根目录添加文件,向AI下达指令(例如:「始终使用Tailwind」、「禁止使用try/catch块」)。
.cursorrules - 导入VS Code扩展:只需点击1次,就能将VS Code中的所有配置迁移过来。
- 审查差异:Cursor应用修改的速度很快,一定要审查差异(快捷键-> 接受修改)。
Cmd+Shift+P
不建议做:
- 不要忽略模型切换:根据任务类型在(编码专用)和
claude-3.5-sonnet(推理专用)之间切换。gpt-4o