skip to content

Inline & Next Edit Suggestions

Ghost text accepted with Tab or word by word, and next edit suggestions that predict where the next change goes, built from open files. Asked because quality tracks what you have open.

part ofAI coding toolsread it →
on this pageshow

explore

questions

5

How do you accept, partially accept, cycle or dismiss GitHub Copilot ghost text in VS Code?

level: juniorimportance: must knowfreq 22%

answer

  1. one key takes it all
  2. a word at a time
  3. Command or Control plus right arrow
  4. Alt or Option with brackets
  5. Ctrl+Enter opens a whole tab

basics

~20 s

Tab accepts the whole ghost-text suggestion and Esc dismisses it; Accept Next Word (Command+Right on macOS, Control+Right on Windows and Linux) takes one word, and Alt+] or Alt+[ (Option on macOS) cycles through alternative suggestions.

solid answer

~40 s

In VS Code, `Tab` accepts the whole dimmed suggestion (`editor.action.inlineSuggest.commit`) and `Esc` dismisses it. To take only part of it, **Accept Next Word** is `Command+→` on macOS and `Control+→` on Windows and Linux, or the **Accept Word** button in the control that appears when you hover the suggestion; accepting the next line is a separate command, `editor.action.inlineSuggest.acceptNextLine`, which GitHub's docs tell you to bind yourself. Copilot may hold several alternatives for the same position: hover to get forward and back arrows, or press `Alt+]` / `Alt+[` (`Option` on macOS). `Ctrl+Enter` opens a separate tab with multiple additional suggestions, and `Alt+\` (`Option+\`) triggers a suggestion by hand. Every key can be rebound in the Keyboard Shortcuts editor by searching the command name.

go deeper

for a junior

Recall the four moves cold: Tab accepts, Esc dismisses, Command or Control plus Right takes a word, Alt or Option plus a bracket cycles alternatives.

for a middle

Explain partial acceptance by word and by line, the hover control and the Ctrl+Enter suggestions tab, and that each key maps to a named command you can rebind.

for a senior

Show the habit that keeps generated code honest: accept in small pieces, cycle alternatives instead of editing a bad block, and rebind keys that collide with your team's editor setup.

for a principal

Treat these keys as onboarding material: a team that knows partial accept and alternatives takes less unread code into the file than one that only knows Tab.

## What ghost text is GitHub Copilot in VS Code shows **ghost text**: a dimmed suggestion drawn at the cursor as you type. Sometimes it is the end of the current line, sometimes a whole block such as a function body. You can also steer it with a natural-language comment ("write a function to find all images without alternate text") and Copilot suggests code under it. Nothing is inserted until you accept it, and the keys you use decide **how much** of it lands in the file. ## The default keys GitHub's keyboard-shortcut reference for Copilot in VS Code lists the defaults and the command behind each one: | Action | macOS | Windows / Linux | Command | |---|---|---|---| | Accept the whole suggestion | `Tab` | `Tab` | `editor.action.inlineSuggest.commit` | | Dismiss it | `Esc` | `Esc` | `editor.action.inlineSuggest.hide` | | Next alternative | `Option+]` | `Alt+]` | `editor.action.inlineSuggest.showNext` | | Previous alternative | `Option+[` | `Alt+[` | `editor.action.inlineSuggest.showPrevious` | | Trigger a suggestion | `Option+\` | `Alt+\` | `editor.action.inlineSuggest.trigger` | | More suggestions in a separate pane | `Ctrl+Return` | `Ctrl+Enter` | `github.copilot.generate` | | Toggle Copilot on or off | no default | no default | `github.copilot.toggleCopilot` | **Enter does not accept ghost text**; `Tab` does. ## Partial acceptance A long suggestion is often right for its first few tokens and wrong after that. Instead of accepting and then deleting, take only what you trust: - **Accept Next Word** — `Command+→` on macOS, `Control+→` on Windows and Linux (command `editor.action.inlineSuggest.acceptNextWord`). Press it repeatedly to walk through the suggestion a word at a time; the rest stays as ghost text. - **Accept Word** in the hover control does the same with the mouse. - **Accept the next line** is its own command, `editor.action.inlineSuggest.acceptNextLine`. GitHub's how-to says that to use it you set a custom keyboard shortcut for that command. ## Alternatives and the suggestions tab For a given position Copilot may have more than one suggestion. There are three ways to see them: 1. **Hover** the ghost text. A small control appears with forward and back arrows; click them to cycle, then press `Tab` to take the one showing. 2. Press **`Alt+]` / `Alt+[`** (`Option` on macOS) to move to the next or previous alternative without the mouse. 3. Press **`Ctrl+Enter`** to open a **new tab** listing multiple additional options. Each has an **Accept suggestion NUMBER** link under it; closing the tab rejects them all. The hover control is governed by `editor.inlineSuggest.showToolbar`, whose default is `"onHover"`. ## Triggering by hand and rebinding Ghost text normally appears on its own as you type. When it does not — for example because VS Code treats your connection as metered and stops starting automatic requests — `Alt+\` (`Option+\` on macOS), the **Trigger Inline Suggestion** command, asks for one explicitly. Any of these keys can collide with an existing habit — `Command+→` and `Control+→` are familiar cursor-movement keys. Open the **Keyboard Shortcuts** editor, search for the command name from the table, and rebind it. Because the commands are VS Code's `editor.action.inlineSuggest.*` family, a rebinding changes the key, not the behaviour. ## Steering a suggestion with a comment Ghost text does not have to wait for you to start typing code. Write a comment that describes what you want — a type of algorithm ("use recursion"), a pattern ("use a singleton pattern"), or the methods and properties a class should have — and Copilot suggests the code beneath it. The same keys apply: `Tab` takes the whole body, Accept Next Word walks into it, and `Alt+]` shows another take on the same comment. ## Settings that change how ghost text looks These VS Code settings change presentation, not the keys: | Setting | Default | What it does | |---|---|---| | `editor.inlineSuggest.showToolbar` | `"onHover"` | When the toolbar with the arrows and Accept Word appears | | `editor.inlineSuggest.syntaxHighlightingEnabled` | `true` | Syntax colouring inside the ghost text | | `editor.inlineSuggest.fontFamily` | `"default"` | Font used for the ghost text | | `editor.inlineSuggest.minShowDelay` | `0` | Milliseconds to wait before showing a suggestion | ## Common mistakes - Treating ghost text like an autocomplete list and pressing **Enter** to accept it. - Accepting a whole multi-line block with `Tab` and then deleting most of it, instead of taking it word by word. - Retyping a line because "Copilot only had one idea", when `Alt+]` or `Ctrl+Enter` would have shown others. - Assuming the next-line partial accept has a default key like Accept Next Word does; GitHub's docs say to bind it.

  • Accept Next Word on Control+Right clashes with your word-jump habit. How do you change it without losing the feature?
    Open the Keyboard Shortcuts editor, search for `editor.action.inlineSuggest.acceptNextWord`, and assign a different key. The command and its behaviour are unchanged; only the binding moves. GitHub's docs recommend searching by command name in that editor for every Copilot inline-suggestion shortcut.
  • What does Ctrl+Enter give you that Alt+] does not?
    `Alt+]` cycles the alternatives one at a time in place. `Ctrl+Enter` (`github.copilot.generate`) opens a separate tab that lists multiple additional suggestions together, each with an **Accept suggestion NUMBER** link; closing that tab rejects them all. It suits comparing several bodies side by side.
  • How do you take only the first line of a five-line Copilot suggestion?
    Use the next-line partial accept, the command `editor.action.inlineSuggest.acceptNextLine`. GitHub's how-to says you set a custom keyboard shortcut for it; once bound, each press accepts one more line and leaves the rest as ghost text. Pressing Accept Next Word repeatedly also works, a word at a time.

  • Pressing Enter accepts a Copilot ghost-text suggestion, like an autocomplete list.
  • You can only take a Copilot suggestion whole or not at all.
  • Copilot offers exactly one suggestion per position, so a bad one must be retyped.
  • Tab accepts only the current line of a multi-line Copilot suggestion.
  • Copilot's inline-suggestion keys are fixed and cannot be rebound in VS Code.
open as a page

How do GitHub Copilot's next edit suggestions in VS Code carry a rename's follow-on edits, and which settings control them?

level: middleimportance: should knowfreq 12%

basics

~20 s

Next edit suggestions (NES) predict both where your next edit goes and what it is, from the edits you just made. A gutter arrow marks it, Tab jumps there and Tab again accepts; github.copilot.nextEditSuggestions.enabled is the switch.

open as a page

GitHub Copilot ghost text in VS Code keeps proposing a library your project does not use — which documented levers steer it back?

level: middleimportance: should knowfreq 9%

basics

~20 s

Copilot builds ghost text from the current file and open tabs, so fix the editor: add the real import, open files using the right library, close unrelated ones, add a top comment or sample. Instruction files do not reach it.

open as a page

A VS Code user gets GitHub Copilot ghost text in TypeScript but none in Markdown or in some repository files — which settings and policies explain it?

level: seniorimportance: should knowfreq 7%

basics

~20 s

Check the switches in order: github.copilot.enable turns ghost text off for markdown, plaintext and scminput by default; a content exclusion blanks specific files and strikes through the status-bar icon; Snooze or a metered connection pauses automatic suggestions.

open as a page

What does GitHub Copilot's Change Completions Model command in VS Code change, and what does it leave untouched?

level: middleimportance: nice to knowfreq 4%

basics

~20 s

Change Completions Model swaps the model behind Copilot's ghost text only; next edit suggestions and Copilot Chat keep their own models, and data policy and the public-code-matching setting are unchanged. Business and Enterprise seats need the Editor preview features policy.

open as a page