Stop Neovim from previewing completions inline without an AI source - #8759
Open
nico93f wants to merge 1 commit into
Open
Stop Neovim from previewing completions inline without an AI source#8759nico93f wants to merge 1 commit into
nico93f wants to merge 1 commit into
Conversation
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>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an idempotent migration that disables Neovim completion ghost text unless explicitly configured otherwise.
Changes:
- Appends
vim.g.ai_cmp = falseto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/nvimis user-owned and/etc/skelseeds 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-nvimenables no AI extra — itslazyvim.jsonlists onlyeditor.neo-tree— so the sources arelsp,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 conson line 3, stockomarchy-nvim2026.8.13:After:
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_cmpis LazyVim's own switch for this: its AI extras read the same flag (copilot, supermaven and codeium all setsuggestion.enabled = not vim.g.ai_cmp), so a user who enables one gets that provider's native inline suggestions, still accepted with<Tab>throughLazyVim.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 of1781587663.sh. It skips anyoptions.luathat already mentionsai_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.shcovers the stock file, a rerun, a deliberatevim.g.ai_cmp = true, and a home without a Neovim config../test/allis otherwise unchanged:snapper-test.shandtheme-install-guards-test.shfail onquattroin my environment too, before this branch — one wants a siblingomarchy-isocheckout, the other reaches the network.Behaviour was verified in a real editor, not only in the migration: the captures above are
tmux capture-paneof stock/etc/skel/.config/nvimand a patched copy running side by side against the shipped plugin cache, andrequire("blink.cmp.config").completion.ghost_text.enabled()returnstruebefore andfalseafter.