Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Cursor @ Symbol

Cursor @ Symbol

In Cursor, the @ symbol is a powerful tool for quickly accessing and referencing various context information, helping users interact with AI more efficiently.

Typing @ in any AI interaction scenario (such as the ⌘K command palette, chat window, or terminal) triggers a context menu that automatically filters and recommends the most relevant resources in the current project (such as files, code snippets, documents, etc.).


@ Symbol

The @ symbol supports the following main commands:

Function Description Use Cases
@Files Reference an entire file as context. Supports file path preview and chunked processing. When you need to reference specific file content, such as code files, documents, etc.
@Folders Reference an entire folder as context. When you need to provide a large number of files as context, such as a project directory.
@Code Reference a specific code snippet as context. When you need to query or operate on a specific code snippet.
@Codebase Search the codebase for important files or code blocks and reorder them by relevance. When you need to find related code or files across the entire codebase.
@Git Scan Git commits, diffs, or pull requests to help find issues. When you need to analyze Git-related information, such as commit history, code diffs, etc.
@Web Search web information as additional context. When you need to obtain the latest web information or external resources.
@Docs Reference preset third-party or custom documents. Supports adding custom documents. When you need to reference external documents or a custom knowledge base.
@Definitions Reference all definitions in the vicinity as context. When you need to reference definitions such as variables and functions in the current code.
@Chat Add the current chat message as context. When you need to reference previous conversation content in the chat.

Advanced Tips

**Combine commands:** Type @Files src/utils/helper.js @Codebase to reference a specific file and associate the global codebase context at the same time, generating highly customized code.

**Dynamic resource integration:** Paste a link starting with @ (such as @https://api.example.com/docs), and Cursor will automatically parse the content and include it in the context.

**Privacy and configuration management:** Through the .cursorignore file (similar to .gitignore) to exclude sensitive files or directories from indexing. Add custom document links in Settings > Features > Docs to enhance the coverage of @Docs.

Typical Application Scenario Examples

1. Code Generation

**2. Error Troubleshooting**

3. Cross-file Refactoring