Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add chinese version docs for symbol #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions context/@-symbols/@-chat_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: "@Chat"
---

<Info>
此功能目前仅适用于Cmd K。
</Info>

### `@Chat`

您可以通过在Cmd K中使用`@Chat`将当前聊天消息添加为上下文。
当您与AI进行对话并希望将其应用于编辑或生成代码时,这非常有用。

<Frame>
<img src="/images/context/@chat.png" />
</Frame>
27 changes: 27 additions & 0 deletions context/@-symbols/@-code_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: "@Code"
---

### `@Code`

要引用特定的代码段,您可以使用`@Code`符号。

### 代码预览

与[`@Files`](/context/@-symbols/@-files)符号类似,Cursor将显示代码内容的预览,以便您可以验证您引用的代码是否正确。

<Frame>
<img src="/images/context/@code.png"/>
</Frame>

### 从编辑器

添加代码片段作为上下文的另一种方式是选择您想要引用的代码,然后点击"添加到聊天"(`Ctrl/⌘ Shift L`)或"添加到编辑"(`Ctrl/⌘ Shift K`)。

这些操作将把选定的代码片段添加到聊天输入框或当前活动的Cmd K提示栏中。

<Frame>
<img src="/images/context/@code-select.png"/>
</Frame>

要将选定的代码添加到新的聊天中,您可以按`Ctrl/⌘ L`。
23 changes: 23 additions & 0 deletions context/@-symbols/@-codebase_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "@Codebase"
---

### `@Codebase`

<Frame>
<img src="/images/chat/@codebase.png" />
</Frame>

通过 `@Codebase`,Cursor Chat 会经历以下步骤,直到找到最相关的代码片段来使用。

- Gathering(收集):扫描您的代码库以查找重要的文件/代码块
- Reranking(重新排序):根据查询的相关性重新排序上下文项
- Reasoning(推理):通过思考制定使用上下文的计划
- Generating(生成):生成响应

提交高级代码库查询的另一种方法是点击 `Ctrl/⌘ + Enter` 按钮旁边的下拉菜单,并选择 `reranker` 作为搜索行为。
这仅在未使用 `@Codebase` 时可用,否则 `@Codebase` 将优先生效。

<Frame>
<img src="/images/chat/codebase-dropdown.png" />
</Frame>
15 changes: 15 additions & 0 deletions context/@-symbols/@-definitions_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "@Definitions"
---

<Info>
此功能目前仅适用于Cmd K。
</Info>

### `@Definitions`

`@Definitions`符号将所有附近的定义作为上下文添加到Cmd K中。

<Frame>
<img src="/images/context/@definitions.png" />
</Frame>
35 changes: 35 additions & 0 deletions context/@-symbols/@-docs_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: "@Docs"
---

### `@Docs`

<Frame>
<img src="/images/context/@docs.png"/>
</Frame>

Cursor自带一套已爬取、索引并准备好作为上下文使用的第三方文档。您可以使用`@Docs`符号来访问它们。

### 添加自定义文档

如果您想爬取和索引尚未提供的自定义文档,您可以通过`@Docs` > `Add new doc`来实现。
在您粘贴所需文档的URL后,将出现以下模态框:

<Frame>
<img src="/images/context/@docs-add.png"/>
</Frame>

然后Cursor将索引并学习该文档,您就可以像使用其他文档一样将其作为上下文使用。

<Frame>
<img src="/images/context/@docs-learning.png"/>
</Frame>

### 管理自定义文档

在`Cursor设置` > `功能` > `文档`下,您将看到您添加的文档。
您可以在这里编辑、删除或添加新文档。

<Frame>
<img src="/images/context/@docs-manage.png"/>
</Frame>
43 changes: 43 additions & 0 deletions context/@-symbols/@-files_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "@Files"
---

### `@Files`

在Cursor Chat和Cmd K等AI输入框中,您可以使用`@Files`引用整个文件。
此外,如果您在`@`之后继续输入,您将在[`@Code`](/context/@-symbols/@-code)策略之后看到您的文件搜索结果。

为了确保您引用的文件是正确的文件,Cursor将显示文件路径的预览。当您在不同文件夹中有多个同名文件时,这特别有用。

<Frame>
<img src="/images/context/@file.png"/>
</Frame>

### 聊天中的长文件引用

在Cursor的聊天中,如果文件内容太长,Cursor会将文件分割成更小的块,并根据与查询的相关性重新排序。

<Frame>
<img src="/images/context/@file-long-file.png"/>
</Frame>

### Cmd K的分块策略

对于Cmd K,Cursor也会根据内容长度以不同方式使用文件引用。

- auto(自动)
- 根据文件大小自动选择三种读取策略之一
- full file(完整文件)
- 整个文件被用作上下文。
- outline(大纲)
- Cursor解析文件的大纲并将信息用作上下文。
- chunks(分块)
- Cursor将文件分割成更小的块并选择最相关的一个。

<Frame>
<img src="/images/context/@file-cmdk.png"/>
</Frame>

### 拖放

您也可以从主侧边栏将文件拖放到聊天或Cmd K中,以将它们添加为上下文。
15 changes: 15 additions & 0 deletions context/@-symbols/@-folders_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "@Folders"
---

<Info>
目前,`@Folders`仅在Cursor Chat中支持。
</Info>

### `@Folders`

您也可以在Cursor中将整个文件夹作为上下文引用。`@Folders`对于[长上下文聊天](/chat/overview#long-context-chat)特别有用,在这种情况下,您希望为AI提供大量上下文。

<Frame>
<img src="/images/context/@folder.png"/>
</Frame>
29 changes: 29 additions & 0 deletions context/@-symbols/@-git_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: "@Git"
---

<Info>
目前,`@Git`仅在Cursor Chat中支持。
</Info>

### `@Git`

在Cursor的聊天中,您可以使用`@Git`将git提交、差异或拉取请求添加到您的提示中。

<Frame>
<img src="/images/context/@git.png"/>
</Frame>

### 常见用例

`@Git`的一个常见用例是允许Cursor的AI扫描差异并查找可能由差异引起的错误或问题。

<Frame>
<img src="/images/context/@git-usecase1.png"/>
</Frame>

您还可以使用`@Diff of Working State`从当前的差异生成提交消息。

<Frame>
<img src="/images/context/@git-commit-message.png"/>
</Frame>
24 changes: 24 additions & 0 deletions context/@-symbols/@-link_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: "粘贴链接"
---

### `'https://your-link.com`'(见下方网站内容)

为了让Cursor在回应前访问链接,请输入`@`然后粘贴链接。

<Frame>
<img src="/images/context/@link.png" />
</Frame>

### 移除链接

默认情况下,我们会自动解析链接并在Cursor Chat中将它们转换为`@Links`。
如果您希望将链接作为纯文本显示,请点击链接,然后点击`Unlink`。

<Frame>
<img src="/images/context/@link-unlink.png" />
</Frame>

<url_content url="https://your-link.com`">
获取内容时出错:net::ERR_NAME_NOT_RESOLVED at https://your-link.com`
</url_content>
15 changes: 15 additions & 0 deletions context/@-symbols/@-web_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "@Web"
---

### `@Web`

<Frame>
<img src="/images/context/@web.png" />
</Frame>

通过`@Web`,Cursor根据您提供的查询和上下文构建搜索查询,并搜索网络以找到相关信息作为额外的上下文。这对于查找最新信息特别有用。

### 始终开启

您可以通过在`Cursor设置` > `功能` > `聊天`下打开"始终搜索网络",使Cursor在每次查询时都搜索网络。这相当于在每次查询时使用`@web`。
20 changes: 20 additions & 0 deletions context/@-symbols/basic_zh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: 基本用法
---

在Cursor的AI输入框中,如Cmd K、聊天或终端Cmd K,您可以通过输入`@`来使用@符号。将会出现一个弹出菜单,显示建议列表,
并且它会自动过滤,只显示基于您输入的最相关建议。

### 键盘快捷键

您可以使用上/下箭头键在建议列表中导航。您可以按`Enter`键选择一个建议。如果建议是一个类别,比如`Files`,
建议将被过滤,只显示该类别中最相关的项目。

<Frame>
<img src="/images/context/@-symbols-basics.png" />
</Frame>

### Cmd K 键盘快捷键

您可以使用上/下箭头键在选定的Cmd K @符号列表中导航,使用`Enter`键展开/折叠选定的上下文项。对于文件引用,您可以使用
`Ctrl/⌘ M`来切换文件读取策略。在[这里](/context/@-symbols/@-files#cmd-k-chunking-strategy)阅读更多关于文件读取策略的信息。