Skip to content

Extract init.lua customizations to lua/custom/plugins#1994

Closed
bhendo wants to merge 16 commits intonvim-lua:masterfrom
bhendo:refactor/extract-customizations
Closed

Extract init.lua customizations to lua/custom/plugins#1994
bhendo wants to merge 16 commits intonvim-lua:masterfrom
bhendo:refactor/extract-customizations

Conversation

@bhendo
Copy link
Copy Markdown

@bhendo bhendo commented Apr 14, 2026

Summary

  • Move all fork-specific customizations out of init.lua into five new files under lua/custom/plugins/ so merging from upstream kickstart only touches a single line.
  • init.lua diff vs upstream/master is now exactly one line: the { import = 'custom.plugins' } uncomment.
  • Split tool sourcing: LSP servers + codelldb via Mason; jq, prettier, markdownlint from mise global. mypy dropped (unused in config).

What moved where

Customization New file
blink.cmp preset = 'super-tab' lua/custom/plugins/blink-cmp.lua
conform.nvim formatters_by_ft (9 filetypes) lua/custom/plugins/conform.lua
6 kickstart optional plugin enables (debug, indent_line, lint, autopairs, neo-tree, gitsigns) lua/custom/plugins/kickstart-enable.lua
LSP servers (clangd, gopls, pyright, ts_ls, ruff) + pyright's Ruff-delegation settings lua/custom/plugins/lsp.lua
codelldb auto-install (ships as .vsix, can't go through mise) lua/custom/plugins/mason-extras.lua

Mechanisms

  • blink-cmp.lua / conform.lua rely on lazy.nvim's opts deep-merge across duplicate plugin specs.
  • lsp.lua adds a second spec for mason-lspconfig.nvim (kickstart declares it as a bare dep), triggering setup(opts) with ensure_installed + automatic_enable = true. vim.lsp.config('pyright', ...) runs as a top-level side effect during spec import, before mason-lspconfig enables pyright.
  • mason-extras.lua uses a User VeryLazy autocmd + mason-registry API to install codelldb once.

Docs

  • Design spec: docs/superpowers/specs/2026-04-14-nvim-config-refactor-design.md
  • Implementation plan: docs/superpowers/plans/2026-04-14-extract-customizations.md

(These are currently untracked; let me know if you want them committed on a follow-up.)

Test plan

  • nvim starts cleanly (:messages empty)
  • :Lazy lists all expected plugins
  • :checkhealth vim.lsp shows clangd / gopls / pyright / ts_ls / ruff attached on relevant filetypes
  • Pyright settings: :lua =vim.lsp.get_clients({name='pyright'})[1].config.settings includes disableOrganizeImports and ignore = { '*' }
  • :Mason lists lua_ls, stylua, and (after startup) codelldb
  • $PATH inside nvim finds jq, prettier, markdownlint from mise
  • <Tab> accepts a blink.cmp completion
  • <leader>f formats JSON / Python / YAML / markdown / TS files
  • ]c jumps to next gitsigns hunk on a modified file
  • git diff upstream/master HEAD -- init.lua shows only the { import = 'custom.plugins' } uncomment

bhendo added 16 commits June 4, 2025 23:00
Pulls in 50 upstream commits. The key driver is the nvim-treesitter
migration (upstream 7ea937d, 8ac4b12, a6dcf68, e01e1eb, 4021496, c7f05a0)
which switches from the archived `master` branch to `main`, fixing a
crash on Neovim 0.12.1 where render-markdown's injection parsing called
`:range()` on a table returned by the new query API.

Also included from upstream:
- Drop mason-lspconfig setup; use `vim.lsp.config/enable` loop directly
  (upstream ad246eb, 1f4c21f — blink supplies capabilities itself)
- Various kickstart plugin cleanups (autopairs, debug, gitsigns,
  indent_line, lint, neo-tree, health)
- stylua config + workflow updates

Local customizations preserved:
- Custom keymaps and copy_path helper in lua/custom/plugins/init.lua
- Extra LSP servers (clangd, gopls, pyright, ts_ls, ruff)
- Extra mason tools (markdownlint, mypy, jq, prettier, codelldb)
- Enabled kickstart.plugins.{debug,indent_line,lint,autopairs,neo-tree,gitsigns}

Post-merge: users must have tree-sitter CLI available
(brew install tree-sitter-cli) so the main-branch plugin can recompile
parsers against the new query files.
Merge upstream/master: migrate to nvim-treesitter main branch
- Restore pyright inline comments explaining Ruff delegation
- Add header comment documenting mason-lspconfig/vim.lsp.config coupling
- Unwrap lsp.lua outer spec table (consistency with blink-cmp.lua, conform.lua)
- pcall mason-registry.get_package (defensive against unknown package name)
- Split inline autocmd opts across lines (style)
@bhendo
Copy link
Copy Markdown
Author

bhendo commented Apr 14, 2026

Opened against wrong base — closing. This is fork-internal refactor work, not intended for upstream.

@bhendo bhendo closed this Apr 14, 2026
@bhendo bhendo deleted the refactor/extract-customizations branch April 15, 2026 07:24
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.

1 participant