Learn to reference code using @Code symbol and keyboard shortcuts for adding code to Chat or EditTo 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’s content so you can verify that the code you’re referencing is the correct one.From the Editor#
Another way to add code snippets as context is to select the code you want to reference, and click on either “Add to Chat” (Ctrl/⌘ Shift L
) or “Add to Edit” (Ctrl/⌘ Shift K
).These will add the selected code snippet to either the Chat input box or the currently active Cmd K prompt bar.To add a selected code to a new chat, you can press Ctrl/⌘ L
. Modified at 2025-03-26 08:51:30