Skip to content

feat(nvim)!: make the nvim setup reproducible and gate the advanced config to dev - #45

Merged
sha1n merged 11 commits into
masterfrom
feat/nvim-reproducible
Oct 1, 2026
Merged

sha1n merged 11 commits into
masterfrom
feat/nvim-reproducible

Conversation

@sha1n

@sha1n sha1n commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Makes the Neovim setup reproducible from the machine profiles and gates the advanced configuration to dev machines. profile install restores 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

  • Replace neodev with lazydev and adapt the plugin config to current APIs
  • Add :ProfileSync: restore plugins to the committed lockfile and install the treesitter parsers
  • Install language servers from the Brewfile instead of Mason; switch TypeScript to the native LSP
  • Harden :ProfileSync: surface lockfile drift and sync failures, await treesitter parser updates
  • Fail profile install when the loaded nvim config lacks :ProfileSync
  • Run the nvim sync only from dev on; essentials machines run stock nvim
  • Keep user-owned ~/.config/nvim targets in update_dotfiles.sh instead of force-relinking

Review notes

  • Breaking: Mason is removed; language servers now come from the Brewfile
  • Breaking: profile install essentials no longer provisions nvim plugins; an already-provisioned machine keeps the dev config until ~/.local/share/nvim/lazy is removed

🤖 Generated with Claude Code

sha1n and others added 8 commits September 30, 2026 19:07
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>
@sha1n sha1n added the enhancement New feature or request label Sep 30, 2026
@sha1n sha1n self-assigned this Sep 30, 2026
sha1n and others added 2 commits September 30, 2026 22:09
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>
@sha1n sha1n changed the title feat(nvim)!: make the nvim setup reproducible from the profile feat(nvim)!: make the nvim setup reproducible and gate the advanced config to dev Sep 30, 2026
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>
@sha1n
sha1n merged commit 23ed600 into master Oct 1, 2026
2 checks passed
@sha1n
sha1n deleted the feat/nvim-reproducible branch October 1, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant