Skip to content

Stop Neovim from previewing completions inline without an AI source - #8759

Open
nico93f wants to merge 1 commit into
omacom:quattrofrom
nico93f:nvim-no-inline-suggestions-without-ai
Open

Stop Neovim from previewing completions inline without an AI source#8759
nico93f wants to merge 1 commit into
omacom:quattrofrom
nico93f:nvim-no-inline-suggestions-without-ai

Conversation

@nico93f

@nico93f nico93f commented Aug 28, 2026

Copy link
Copy Markdown

Companion to omacom/omarchy-pkgs#234, which turns off Neovim's inline completion preview in the seeded config. That one only reaches newly created users — ~/.config/nvim is user-owned and /etc/skel seeds it once — so this migration carries the same line to everyone already running Omarchy.

The problem

LazyVim defaults vim.g.ai_cmp = true, which routes AI completions through the completion menu and switches on blink.cmp's ghost text so the selected item previews inline. omarchy-nvim enables no AI extra — its lazyvim.json lists only editor.neo-tree — so the sources are lsp, path, snippets, buffer, and the inline preview spends its time writing words already on screen back into the line you are typing.

Typing Notes on cons on line 3, stock omarchy-nvim 2026.8.13:

  1   The constitutional convention met in Philadelphia.
  2
  3   Notes on constitutional      <- only "cons" was typed
            constitutional
            convention
          󱄽  caution~

After:

  1   The constitutional convention met in Philadelphia.
  2
  3   Notes on cons
            constitutional
            convention
          󱄽  caution~

The menu is untouched. Only the text that wrote itself ahead of the cursor is gone. It is worst in prose — a commit message, a note, a markdown draft — where the guess comes from nothing but the words already in the file.

ai_cmp is LazyVim's own switch for this: its AI extras read the same flag (copilot, supermaven and codeium all set suggestion.enabled = not vim.g.ai_cmp), so a user who enables one gets that provider's native inline suggestions, still accepted with <Tab> through LazyVim.cmp.actions.ai_accept. Inline suggestions when something can genuinely predict the next words; none when nothing can.

The migration

Appends the setting to ~/.config/nvim/lua/config/options.lua, in the shape of 1781587663.sh. It skips any options.lua that already mentions ai_cmp, so someone who set the flag deliberately — either way — keeps their answer, and rerunning is a no-op. A home with no Neovim config is left alone; nothing is created.

Tests

test/shell.d/nvim-ai-cmp-migration-test.sh covers the stock file, a rerun, a deliberate vim.g.ai_cmp = true, and a home without a Neovim config.

ok - migration turns ai_cmp off in a stock options.lua
ok - migration appends the setting only once
ok - migration leaves a deliberate ai_cmp setting alone
ok - migration no-ops without a Neovim config

./test/all is otherwise unchanged: snapper-test.sh and theme-install-guards-test.sh fail on quattro in my environment too, before this branch — one wants a sibling omarchy-iso checkout, the other reaches the network.

Behaviour was verified in a real editor, not only in the migration: the captures above are tmux capture-pane of stock /etc/skel/.config/nvim and a patched copy running side by side against the shipped plugin cache, and require("blink.cmp.config").completion.ghost_text.enabled() returns true before and false after.

LazyVim defaults vim.g.ai_cmp to true, which routes AI completions through
the completion menu and turns on blink.cmp's ghost text so the selected item
previews inline ahead of the cursor. omarchy-nvim enables no AI extra -- its
lazyvim.json lists only editor.neo-tree -- so the sources are lsp, path,
snippets and buffer, and that preview spends its time writing words already
on screen back into the line being typed:

      1  The constitutional convention met in Philadelphia.
      2
      3  Notes on constitutional
                  ^^^^^^^^^^^^^^ typed "cons", the rest is ghosted from line 1

It is worst in prose, where a guess drawn from the words already in the file
carries nothing the writer does not have.

omacom/omarchy-pkgs#234 turns it off in the seeded config, which only reaches
newly created users: ~/.config/nvim is user-owned and /etc/skel seeds it once.
This appends the same line for everyone already running Omarchy, and skips any
options.lua that mentions ai_cmp so a deliberate setting is left alone. The
test covers both, plus a rerun and a home with no Neovim config at all.

Only the inline preview goes; the completion menu, its sources and its keymaps
are untouched. Enabling one of LazyVim's AI extras still gives inline
suggestions -- copilot, supermaven and codeium set
suggestion.enabled = not vim.g.ai_cmp and render their own, accepted with
<Tab> through LazyVim.cmp.actions.ai_accept.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 28, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an idempotent migration that disables Neovim completion ghost text unless explicitly configured otherwise.

Changes:

  • Appends vim.g.ai_cmp = false to existing Neovim options.
  • Preserves explicit user settings and absent configurations.
  • Adds migration tests covering updates, reruns, overrides, and no-config homes.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
migrations/1787927123.sh Applies the guarded Neovim setting.
test/shell.d/nvim-ai-cmp-migration-test.sh Verifies migration behavior and idempotency.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants