@Code
To reference specific sections of code, you can use the @Code
symbol.
Code Preview
Similar to the @Files
symbol, Cursor will show a preview of the code content so you can verify that you're referencing the correct code.
Adding from Editor
Another way to add code snippets as context is to select the code you want to reference, then click "Add to Chat" (Ctrl/⌘ Shift L
) or "Add to Edit" (Ctrl/⌘ Shift K
).
These actions will add the selected code snippet to the chat input box or the currently active Cmd K prompt bar.
To add the selected code to a new chat, you can press Ctrl/⌘ L
.
@Code
- Code Preview
- Adding from Editor