Repository navigation
feat(nvim)!: make the nvim setup reproducible and gate the advanced config to dev - #45
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd LSP formulae Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Move init.lua to config/nvim/ and link ~/.config/nvim as a directory, so lazy-lock.json is tracked. install.sh moves the old layout to ~/.config/nvim.bak.<epoch>. - Pin plugins with the committed lazy-lock.json; bootstrap lazy.nvim at its locked commit. - Add :ProfileSync (restore, clean, install treesitter parsers, exit non-zero on failure); profile install runs it headless for every profile. - Replace Mason with Brewfile formulae: lua-language-server and stylua in essentials; gopls, basedpyright and typescript-language-server in dev. init.lua enables each listed server whose binary is on PATH. - Parsers no longer compile at startup. BREAKING CHANGE: dotfiles/init.lua moved to config/nvim/init.lua, and ~/.config/nvim is now a link to config/nvim. Mason and mason-lspconfig are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… LSP Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uage-server typescript-language-server cannot use the Homebrew typescript formula (TypeScript 7 has no tsserver.js), so it failed outside projects with their own typescript package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lazy.setup installs the plugins that are missing at startup and then rewrites the whole lockfile from the installed commits, so one new plugin loses the committed entry of every plugin whose installation is behind the lockfile. Read the committed file before setup, write it back after setup and after a failed sync, and drop lazy's in-memory lock cache, so restore targets the committed versions. Turn off headless process streaming, so a failed process is logged at ERROR level and task:has_errors() sees it. Collect task errors from to_clean and treat a leftover plugin directory as a failed removal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The :TSUpdate build hook starts an async update that restore does not await, and install skips a parser that is present but stale, so qall! could kill an in-flight update and report success with stale parsers. update selects by revision and waits on an in-flight install of the same parser, so awaiting it blocks until every parser is at the pinned revision. Assert both results, so a task failure fails the sync even when the presence checks pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A ~/.config/nvim that is not this repo's has no :ProfileSync, and an init.lua that fails early loses it; a bare +ProfileSync then leaves headless nvim waiting for input forever. Wrap the call in pcall and cquit on error, so every failure reaches the exit status. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
profile install essentials runs brew bundle alone; dev and workstation run the nvim sync (now with --cmd lua vim.g.profile_sync = true before the +lua pcall wrapper) between brew and mise. The Brewfile keeps neovim and vim in essentials and lists tree-sitter-cli, lua-language-server and stylua in dev. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
essentials keeps the neovim binary so the vim alias works, but runs it stock: init.lua returns early when lazy.nvim was never provisioned. No file stores a profile selection - the provisioned lazy.nvim install is the signal, and a ProfileSync run sets vim.g.profile_sync via --cmd before init.lua loads so it can provision from scratch. profile install gates the nvim sync on the dev chain, the same rule as mise install, and the Brewfile moves tree-sitter-cli, lua-language-server and stylua next to the other language servers in dev. BREAKING CHANGE: `profile install essentials` no longer provisions the nvim plugins, language servers or treesitter parsers; run `profile install dev` for the full nvim setup. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ln -sfn silently deleted a regular file at ~/.config/nvim and redirected a link to a foreign config. Link only when the target is absent or already links to the repo, with the same guards as install.sh. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Makes the Neovim setup reproducible from the machine profiles and gates the advanced configuration to dev machines.
profile installrestores plugins to the committed, pinned versions and installs the treesitter parsers, and it fails loudly when any step fails. Language servers come from the Brewfile instead of Mason. Essentials machines keep nvim but run it stock.Changes
:ProfileSync: restore plugins to the committed lockfile and install the treesitter parsers:ProfileSync: surface lockfile drift and sync failures, await treesitter parser updatesprofile installwhen the loaded nvim config lacks:ProfileSyncdevon; essentials machines run stock nvim~/.config/nvimtargets inupdate_dotfiles.shinstead of force-relinkingReview notes
profile install essentialsno longer provisions nvim plugins; an already-provisioned machine keeps the dev config until~/.local/share/nvim/lazyis removed🤖 Generated with Claude Code