Cursor 入门:你的 AI 编程搭档
我的理解
Cursor 是一款深度集成 AI 能力的代码编辑器,通过聊天面板、Composer 模式和代码库搜索三大核心功能,将 AI 结对编程体验内嵌于开发流程,它不只是代码片段生成器,而是能从注释、提示词和代码结构中学习的 AI 助手。从 Cursor 出发,学习者将逐步解锁三种渐进的编程范式:注释驱动(把注释转化为代码)、提示词驱动(通过对话塑造逻辑)和目标导向(将整个目标交给 AI Agent 完成)。这三种范式的演进本质上是将人类的工作重心从语法细节逐步上移到架构设计与目标定义,重新定义了人机协同的分工方式,也为后续所有课程奠定了基础。
相关链接
- Ch08-L03 注释驱动编程 让 AI 来填补空白 — 三种范式的第一层:注释驱动编程
- Ch08-L04 面向提示词的编程 通过对话写出更好的代码 — 从注释升级到对话式编程
- Ch08-L05 目标导向编程 让智能体动起来 — 范式演进的最高层:目标导向与 Agent
- Ch04-L04 学习要点 1 有选择地把任务委托给 AI — 三种范式都是有选择地将任务委托给 AI 的具体实现
原文
Lesson 60 of 68 Cursor 入门:你的 AI 编程搭档 / Getting Started with Cursor: Your AI Coding Partner
想象一下,你坐下来准备写代码,身旁就有一位安静沉稳的协作者,在你刚开始敲键盘的那一刻便能给出周到的建议。这正是 Cursor 为你的工作流带来的体验。可以把它看作一位深度集成在编辑器中的专属 AI 结对程序员。上手过程非常简单:从 https://www.cursor.com/ 安装完成后,启动编辑器,Cursor AI 便已就位。你无需任何繁琐操作——只要打开一个文件,开始写注释或起草代码,就能看到 Cursor 给出相关的代码补全建议。
你会注意到它有着简洁的界面:一个专门的聊天面板,让你能够进行自然对话;一个 Composer 模式,用于处理更具编排性的任务;以及代码库搜索功能,帮助 Cursor 理解你的整个项目。当你第一次看到它自动补全函数或润色 docstring 时,你会意识到这绝非一个普通的代码片段生成器。它是一位会从你的提示、注释和代码结构中学习的 AI 助手,能以传统工具无法企及的方式提升你的工作效率。
你输入一个请求——也许是“解释这个函数”或者“将这段代码重构得更高效”——然后看着 Cursor 给出建议,你可以随心选择接受、拒绝或修改。试用几分钟后,你会发现自己越来越少地依赖搜索引擎或文档页签,而是更多地依靠 Cursor 即时、贴合上下文的知识。
当你逐渐熟悉这些基础用法后,会发现 Cursor 远不止是一个便捷的插件。它解锁了多种全新的编码方式:先是把注释转化为代码,然后通过完整的对话在更高层面塑造逻辑,最终走向更以目标为导向的模式——让 AI 真正成为一名能动的 Agent。这些不断演进的思维方式——面向注释的编程、面向提示的编程,以及面向目标的编程——将彻底改变你对开发的理解。很快,你就会发现自己不再停留于安装和快速修复,而是在人类的指引与 AI 的执行之间,体会到一种更为丰富的协同关系,并为后续所有课程奠定坚实基础。
English Original
Imagine sitting down to code and having a quiet, steady-handed collaborator ready to offer thoughtful suggestions the moment you start typing. That’s what Cursor brings to your workflow. Think of it as a specialized AI pair programmer integrated right into your editor. Getting it up and running is straightforward: after installing it from https://www.cursor.com/, launch your editor and you’ll find the Cursor AI waiting. You won’t need to jump through hoops—just open a file, begin commenting or drafting your code, and see Cursor propose relevant completions.
You’ll notice a sleek interface: a dedicated chat panel that lets you engage in natural dialogue, a composer mode for more orchestrated tasks, and codebase search features that help Cursor understand your entire project. The first time you see it autocomplete a function or refine a docstring, you’ll realize this isn’t a mere snippet generator. It’s an AI assistant that learns from your prompts, your comments, and your code structure, enhancing your productivity in a way traditional tools never could.
You type in a request—maybe something like “Explain this function” or “Refactor this code to be more efficient”—and watch as Cursor responds with suggestions you can accept, reject, or modify at will. After a few minutes of experimenting, you’ll find yourself relying less on search engines or documentation tabs and more on Cursor’s immediate context-driven knowledge.
As you grow comfortable with these basics, you’ll find Cursor is more than a convenient add-on. It unlocks different ways of approaching coding: first by turning comments into code, then by engaging in full conversations to shape logic at a higher level, and eventually by embracing a more objective-driven mode where the AI becomes a true agent. These evolving mindsets—comment-oriented programming, prompt-oriented programming, and objective-oriented programming—will transform how you think about development. Soon, you’ll feel yourself moving beyond just installations and quick fixes, discovering a richer interplay of human direction and AI-driven execution that lays the foundation for all the lessons to come.