Step 3: Handling Suggestions
Here's how to interact with the suggestions Cursor provides:
Accepting Suggestions
Inline (Ghost Text): Press the Tab key
to accept the entire greyed-out suggestion.
Partial (Inline): Press Cmd+→
(Mac) or Ctrl+→ (Win/Lin) to accept only the
*next word* of the inline suggestion.
Cmd+K / Chat Generated: Click the "Apply" or
"Accept" button usually presented with the generated code block.
Rejecting Suggestions
Inline (Ghost Text): Press the
Esc key, or simply keep typing your own code to ignore
the suggestion.
Cmd+K / Chat Generated: Click "Discard" or press
Cmd+Backspace (Mac) or Ctrl+Backspace
(Win/Lin) to dismiss the suggestion.
Best Practices
-
Review Before Accepting: Always scan through
suggestions to ensure they match your intent and follow your
code's style/approach.
-
Keep Context Clear: The more organized and
well-commented your code is, the better the suggestions will be.
-
Iterate When Needed: If the first suggestion
isn't quite right, try modifying your prompt or adding more
specific details.
-
Use @-references: Reference specific files or
folders (using @filepath) in
your prompts for more contextually aware suggestions.
-
Keyboard Efficiency: Master the keyboard
shortcuts (Tab, Esc,
Cmd/Ctrl+Enter, etc.) to quickly handle
suggestions.