Inline suggestions & ghost text
Copilot predicts the next characters, lines or whole blocks as you type and shows them as dimmed ghost text. Next edit suggestions go further — predicting where your next edit should happen and what it should be.
Ghost text in action
Type a signature, pause, and Copilot proposes the rest. Accept all of it, a word at a time, or dismiss it.
1// Format a price for display in the user's currency2export function34567
Getting multi-line suggestions
Copilot decides the length of a suggestion from context. These patterns reliably produce full blocks.
Keep typing
Suggestions appear automatically as dimmed ghost text after a short pause. They can be single-line or a whole block.
Write a comment
A descriptive comment above an empty function body is the most reliable multi-line trigger: Copilot completes the implementation below it.
Start a signature
A typed function name and parameters (e.g. function formatPrice() give strong intent. Good names beat long comments.
Press Enter inside a block
A new line inside a function, object or loop body often yields a multi-line suggestion for the rest of the block.
Trigger manually
Press ⌥+\ (macOS) or Alt+\ (Windows/Linux) to request a suggestion when none is showing.
See alternatives
Hover the suggestion for the toolbar, or cycle with ⌥+] / ⌥+[. Ctrl+Enter opens a pane with more suggestions.
Accepting, partially accepting and cycling (VS Code)
Partial acceptance lets you take the part of a suggestion you trust and keep typing.
| Action | macOS | Windows / Linux |
|---|---|---|
Accept inline suggestion editor.action.inlineSuggest.commit | Tab | Tab |
Dismiss inline suggestion editor.action.inlineSuggest.hide | Esc | Esc |
Accept next word of suggestion editor.action.inlineSuggest.acceptNextWord | ⌘+→ | Ctrl+→ |
Accept next line of suggestion Accept Next Line Of Inline Suggestion | — | — |
Show next suggestion editor.action.inlineSuggest.showNext | ⌥+] | Alt+] |
Show previous suggestion editor.action.inlineSuggest.showPrevious | ⌥+[ | Alt+[ |
Trigger inline suggestion editor.action.inlineSuggest.trigger | ⌥+\ | Alt+\ |
Open more suggestions in a separate pane github.copilot.generate | Ctrl+Return | Ctrl+Enter |
Jump to next edit suggestion | Tab | Tab |
Accept next edit suggestion | Tab | Tab |
Reject next edit suggestion | Esc | Esc |
Accept next line has no default key
editor.action.inlineSuggest.acceptNextLine exists but is unbound. Add your own binding — see the snippet.// keybindings.json — bind "accept next line", which has no default key
[
{
"key": "ctrl+alt+right",
"command": "editor.action.inlineSuggest.acceptNextLine",
"when": "inlineSuggestionVisible && !editorReadonly"
}
]Next edit suggestions (NES)
NES predicts the location and content of your next edit based on edits you just made — even far from the cursor.
1interface Point3D { x: number; y: number; z: number; }2function distance(a: Point3D, b: Point3D) {4return Math.hypot(a.x - b.x, a.y - b.y);4return Math.hypot(a.x - b.x, a.y - b.y, a.z - b.z);5}
You added z to the interface → Copilot NES proposes the matching change. Tab to jump, Tab to accept.
An arrow in the gutter marks a pending suggestion. Press Tab to jump to it, then Tab again to accept, or Esc to dismiss.
Typical wins: propagating a renamed variable, adding a new field everywhere it's needed, fixing a typo pattern, or updating call sites after a signature change.
Enable it with github.copilot.nextEditSuggestions.enabled. NES is generally available in VS Code and Visual Studio, and in preview in JetBrains, Eclipse and Xcode.
{
// Turn inline suggestions on/off globally or per language
"github.copilot.enable": {
"*": true,
"markdown": false,
"plaintext": false
},
// Next edit suggestions (NES)
"github.copilot.nextEditSuggestions.enabled": true,
// Editor-level behaviour for all inline suggestions
"editor.inlineSuggest.enabled": true,
"editor.inlineSuggest.showToolbar": "onHover"
}Custom instructions don't apply here
Context = what's open