编辑神器CursorAI

编辑神器CursorAI

Tags
Tools
Published
Author
 
2023年3月,在ChatGPT风靡全球的时候,一款名为 Cursor 的代码编辑器横空出世,并且在技术圈里获得一致好评。它功能非常强大,用GPT辅助你编程,智能生成代码、修改 Bug、生成测试等等需求它都能够满足你!Cursor 编译器用户每个月可以免费使用 GPT-3.5 200 次和慢速 GPT-4.0 50 次。对于像大学生这样需求不大的用户来说,这样的免费额度已经足够使用。但对于更高频率使用该工具的用户,Cursor 也提供了付费会员选项,允许更频繁地使用其高级功能。
 
Cursor的AI编程能力完全超越VSCode,且界面和VSCode几乎一样;除了编程,还可以通过安装不同的插件来实现编辑文档,编辑Markdown文本,编辑Mermaid流程图等等;
更强的是,通过右下角的聊天窗口,可以让Cursor AI对计算机硬盘上的文档进行查询,解读,问答,修改等能力;换句话说,无需担心信息泄露(相对于把文档上传到GPT网站),可以让Cursor AI来探索本地计算机上的文档知识库,然后消化理解,摇身一变成为专家来快速回答你的问题;
 
FAE同事可以向Janet申请API Key来解锁免费无限使用Cursor的AI能力~

可以安装中文语言包,配置中文界面(万一你需要)

notion image

参考以下截图配置API Key

notion image
 

Tab键,一键自动完成

Cursor includes a powerful autocomplete that predicts your next edit. Once enabled, it is always on and will suggest edits to your code across multiple lines, taking into account your recent changes.
Cursor 包含功能强大的自动完成功能,可预测你的下一次编辑。一旦启用,它将始终保持开启状态,并在考虑到最近更改的情况下,对多行代码提出编辑建议。

Code Generation 代码生成

Cursor sees your recent changes, so it can predict what you want to do next.
Cursor 可以看到您最近的更改,因此可以预测您下一步要做什么。
notion image

Multi-Line Edits 多行编辑

Cursor can suggest multiple edits at once, saving you time.
Cursor 可同时建议多项编辑,节省您的时间。
notion image

Smart Rewrites 智能改写

Type carelessly, and Cursor will fix your mistakes.
如果输入不小心,Cursor 会帮你纠正错误。
notion image

Cursor Prediction, 光标预测

Cursor predicts your next cursor position so you can seamlessly navigate your code.
Cursor 会预测你的下一个光标位置,这样你就可以无缝地浏览代码。
notion image

Chat 聊天

Chat lets you talk with an AI that sees your codebase. The chat can always see your current file and cursor, so you can ask it things like: "Is there a bug here?". You can add particular blocks of code to the context with Ctrl+Shift+L or "@." You can chat with your entire codebase with Ctrl+Enter.
聊天功能可让你与人工智能对话,它能看到你的代码库。聊天机器人可以看到你当前的文件和光标,所以你可以问它一些问题,比如:"这里有 bug 吗?您可以使用 Ctrl+Shift+L 或"@"将特定代码块添加到上下文中。使用 Ctrl+Enter 可以与整个代码库聊天。

Codebase Answers 代码库答案

Use @Codebase or Ctrl Enter to ask questions about your codebase. Cursor will search your codebase to find relevant code to your query.
使用 @Codebase 或按 Ctrl Enter 键询问有关代码库的问题。Cursor 会搜索你的代码库,找到与你的问题相关的代码。
notion image

Reference your Code 参考您的代码

Reference code with @ symbols to be used as context for the AI. Just type @ to see a list of all the files and code symbols in your folder.
使用 @ symbols 作为人工智能上下文的参考代码。只需键入 @,即可查看文件夹中所有文件和代码符号的列表。
notion image

Use Images 使用图片

Hit the image button under chat or drag an image into the input box to include visual context into chat.
点击聊天下方的图片按钮,或将图片拖入输入框,即可在聊天中加入可视化语境。
notion image

Ask the Web 网络问答

Get up-to-date information from the internet with @Web. Cursor will search the web for you and use the latest information to answer your question.
使用 @Web 从互联网上获取最新信息。Cursor 会为你搜索网络,并使用最新信息回答你的问题。
notion image

Instant Apply 立刻应用

Apply the code suggestions from chat back into your codebase by clicking the play button on top of any chat codeblock.
点击任何聊天代码块顶部的播放按钮,将聊天中的代码建议应用到您的代码库中。
notion image

Use Documentation 使用文档

Reference popular libraries using @LibraryName, or add your own using @Docs → Add new doc.
使用 @LibraryName 引用常用图书馆,或使用 @Docs → 添加新文档添加自己的图书馆。
notion image

Ctrl K

Ctrl K lets you edit and write code with the AI. To edit, try selecting some code, click "Edit," and describe how the code should be changed. To generate completely new code, just type Ctrl K without selecting anything.
按住 Ctrl K 键,就可以用人工智能编辑和编写代码。要编辑代码,请尝试选择一些代码,点击 "编辑",并描述代码应如何更改。要生成全新的代码,只需键入 Ctrl K,而无需选择任何内容。

Fast Edits 快速编辑

Edit and write code with the AI. Select some code, click Ctrl K, and describe how the code should be changed. Or, generate new code with Ctrl K without selecting anything.
使用人工智能编辑和编写代码。选择一些代码,单击 Ctrl K,然后描述如何修改代码。或者,在不选择任何内容的情况下,按 Ctrl K 键生成新代码。
notion image

Terminal Ctrl K 终端 Ctrl K

Use Ctrl K in the terminal to write terminal commands in plain english. Cursor will convert them into the terminal command you need.
在终端中使用 Ctrl K 以普通英语编写终端命令。Cursor 会将其转换为所需的终端命令。
notion image

Quick Questions 快速提问

If you have any quick questions about certain parts of your code, you can select and click on "quick question" to get your answer right away.
如果您对代码的某些部分有任何快速问题,可以选择并点击 "快速问题",立即获得答案。
notion image
 
~~~~~~~~~完~~~~~~~美~~~~~~~~~