From 348560c7799b2ecf626138dc6166745353a93eef Mon Sep 17 00:00:00 2001 From: HuNtErJ1324 Date: Sun, 21 Jun 2026 15:15:34 -0700 Subject: [PATCH 1/4] Replay personal customizations onto the new vim.pack kickstart base Re-apply the user's customizations (previously living as an uncommitted diff on the OLD lazy.nvim kickstart base) onto the new single-file vim.pack-based kickstart, adapting them to the new architecture: - Enable Nerd Font (have_nerd_font = true). - VimTeX: lua/custom/plugins/vimtex.lua (ported from the lazy `lazy=false` spec to vim.pack; globals set before load, zathura viewer, latexmk) plus the three l keymaps. - nvim-java: lua/custom/plugins/nvim-java.lua installs the plugin only (mirrors the user's original `return { 'nvim-java/nvim-java' }`; wiring is finished in a later commit). - LSP servers: add jdtls, plus ty (Astral's Python type checker) and ruff. ty is not in nvim-lspconfig, so it's defined via the new vim.lsp.config API (cmd/filetypes/root_markers) instead of the old lspconfig.configs path. - Mason: exclude ty and ruff from auto-install (installed separately via uv). - conform: re-apply the user's formatter entries. - treesitter: add `latex` to the installed parsers. - Enable the optional kickstart modules the user had on (debug, indent_line, lint, autopairs, neo-tree, gitsigns) and the custom.plugins loader, via the new base's `require` mechanism (not lazy `import`). - lint.lua: guard markdownlint behind `vim.fn.executable`. - debug.lua: add java-debug-adapter and java-test to mason-nvim-dap. Co-Authored-By: Claude Opus 4.8 --- init.lua | 53 ++++++++++++++++++++++++-------- lua/custom/plugins/nvim-java.lua | 7 +++++ lua/custom/plugins/vimtex.lua | 27 ++++++++++++++++ lua/kickstart/plugins/debug.lua | 2 ++ lua/kickstart/plugins/lint.lua | 4 ++- 5 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 lua/custom/plugins/nvim-java.lua create mode 100644 lua/custom/plugins/vimtex.lua diff --git a/init.lua b/init.lua index aff5250e921..c0ac69c63fa 100644 --- a/init.lua +++ b/init.lua @@ -99,7 +99,7 @@ do vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal - vim.g.have_nerd_font = false + vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -705,6 +705,30 @@ do stylua = {}, -- Used to format Lua code + -- Java language server (installed via Mason). + jdtls = {}, + + -- ty: Astral's Python type checker. Not yet shipped by nvim-lspconfig, so we + -- define the whole config here (ported from the old `lspconfig.configs.ty` + -- approach to the new `vim.lsp.config` API). Installed separately via uv, so + -- it is excluded from Mason below. + ty = { + cmd = { 'ty', 'server' }, + filetypes = { 'python' }, + root_markers = { 'pyproject.toml', 'ty.toml', '.git' }, + }, + + -- ruff: Python linter/formatter LSP. nvim-lspconfig ships the base `ruff` + -- config (cmd, etc.); this only overlays init_options. Installed separately + -- via uv, so it is excluded from Mason below. + ruff = { + init_options = { + settings = { + fixAll = true, + }, + }, + }, + -- Special Lua Config, as recommended by neovim help docs lua_ls = { on_init = function(client) @@ -758,6 +782,9 @@ do -- -- You can press `g?` for help in this menu. local ensure_installed = vim.tbl_keys(servers or {}) + -- ty and ruff are installed separately via uv (~/.local/bin), so exclude them + -- from Mason auto-install. + ensure_installed = vim.tbl_filter(function(name) return name ~= 'ty' and name ~= 'ruff' end, ensure_installed) vim.list_extend(ensure_installed, { -- You can add other tools here that you want Mason to install }) @@ -796,12 +823,12 @@ do }, -- You can also specify external formatters in here. formatters_by_ft = { - -- rust = { 'rustfmt' }, + lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- + python = { 'isort', 'black' }, -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + javascript = { 'prettierd', 'prettier', stop_after_first = true }, + SQL = { 'sql-formatter' }, }, } @@ -904,7 +931,7 @@ do vim.pack.add { { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' } } -- Ensure basic parsers are installed - local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } + local parsers = { 'bash', 'c', 'diff', 'html', 'latex', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } require('nvim-treesitter').install(parsers) ---@param buf integer @@ -966,17 +993,17 @@ do -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug' - -- require 'kickstart.plugins.indent_line' - -- require 'kickstart.plugins.lint' - -- require 'kickstart.plugins.autopairs' - -- require 'kickstart.plugins.neo-tree' - -- require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps + require 'kickstart.plugins.debug' + require 'kickstart.plugins.indent_line' + require 'kickstart.plugins.lint' + require 'kickstart.plugins.autopairs' + require 'kickstart.plugins.neo-tree' + require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps -- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- require 'custom.plugins' + require 'custom.plugins' end -- The line beneath this is called `modeline`. See `:help modeline` diff --git a/lua/custom/plugins/nvim-java.lua b/lua/custom/plugins/nvim-java.lua new file mode 100644 index 00000000000..c77d807eb0b --- /dev/null +++ b/lua/custom/plugins/nvim-java.lua @@ -0,0 +1,7 @@ +-- nvim-java: Java IDE layer on top of jdtls. +-- https://github.com/nvim-java/nvim-java +-- +-- NOTE: This only installs the plugin (mirroring the user's original +-- `return { 'nvim-java/nvim-java' }` spec). It is NOT yet initialized, so jdtls +-- currently runs vanilla. Wiring (`require('java').setup()`) is finished later. +vim.pack.add { 'https://github.com/nvim-java/nvim-java' } diff --git a/lua/custom/plugins/vimtex.lua b/lua/custom/plugins/vimtex.lua new file mode 100644 index 00000000000..5ad52dada66 --- /dev/null +++ b/lua/custom/plugins/vimtex.lua @@ -0,0 +1,27 @@ +-- VimTeX: LaTeX support (compile, view, errors) +-- https://github.com/lervag/vimtex +-- +-- Ported from the user's lazy.nvim spec (lazy = false) to this base's `vim.pack` +-- imperative style. VimTeX reads its `vim.g.vimtex_*` settings when it is sourced, +-- so we set them BEFORE `vim.pack.add` loads the plugin (the equivalent of the old +-- lazy `init` hook). + +-- Viewer settings (adjust based on your PDF viewer) +vim.g.vimtex_view_method = 'zathura' -- Use 'skim' on macOS, 'sumatra' on Windows, etc. + +-- Compiler settings +vim.g.vimtex_compiler_method = 'latexmk' -- Default compiler backend + +-- Optional: Disable some features if you don't need them +vim.g.vimtex_quickfix_enabled = 1 -- Enable quickfix window for errors +vim.g.vimtex_syntax_enabled = 1 -- Syntax highlighting (works with Tree-sitter too) + +-- Set TeX flavor (usually not needed, but good to know) +vim.g.tex_flavor = 'latex' + +vim.pack.add { 'https://github.com/lervag/vimtex' } + +-- LaTeX keymaps (which-key group label is defined in init.lua: `l` = [L]aTeX) +vim.keymap.set('n', 'll', 'VimtexCompile', { desc = 'Compile LaTeX' }) +vim.keymap.set('n', 'lv', 'VimtexView', { desc = 'View PDF' }) +vim.keymap.set('n', 'le', 'VimtexErrors', { desc = 'Show Errors' }) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index db5448c2cfc..b7fd7bf0480 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -42,6 +42,8 @@ require('mason-nvim-dap').setup { ensure_installed = { -- Update this to ensure that you have the debuggers for the langs you want 'delve', + 'java-debug-adapter', + 'java-test', }, } diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index d63054452fd..d757185fefc 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -4,7 +4,9 @@ vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' } local lint = require 'lint' lint.linters_by_ft = { - markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm + -- Only enable markdownlint if it is actually installed (it is not installed here), + -- otherwise nvim-lint errors on every markdown buffer. + markdown = vim.fn.executable 'markdownlint' == 1 and { 'markdownlint' } or {}, } -- To allow other plugins to add linters to require('lint').linters_by_ft, From dbbcf92be8e33d4b84cd15f3271cfddbd517b072 Mon Sep 17 00:00:00 2001 From: HuNtErJ1324 Date: Sun, 21 Jun 2026 15:16:40 -0700 Subject: [PATCH 2/4] Apply audited fixes: formatters, dormant tools, which-key label Audit-identified corrections, applied on top of the replayed config: - conform: use the lowercase filetype key `sql` (not `SQL`) so sql-formatter actually fires. - conform: switch Python formatting to `ruff_organize_imports` + `ruff_format` (black/isort are not installed; ruff is and does both jobs). - Wire in installed-but-previously-dormant Mason tools: add `texlab` to the LSP servers (LaTeX LSP, which VimTeX does not provide), and add conform entries `java = { 'google-java-format' }` and tex/plaintex = { 'latexindent' }. - which-key: add a `l` = [L]aTeX group label for the VimTeX maps. Note: the deprecated `vim.highlight.on_yank` -> `vim.hl.on_yank` change from the audit is already present in this newer base, so no change was needed there. Co-Authored-By: Claude Opus 4.8 --- init.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index c0ac69c63fa..9c996d2cf28 100644 --- a/init.lua +++ b/init.lua @@ -371,6 +371,7 @@ do spec = { { 's', group = '[S]earch', mode = { 'n', 'v' } }, { 't', group = '[T]oggle' }, + { 'l', group = '[L]aTeX' }, -- VimTeX maps (see lua/custom/plugins/vimtex.lua) { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first { 'gr', group = 'LSP Actions', mode = { 'n' } }, }, @@ -729,6 +730,10 @@ do }, }, + -- texlab: LaTeX language server (completion/refs/diagnostics). VimTeX does not + -- provide this. Installed via Mason. + texlab = {}, + -- Special Lua Config, as recommended by neovim help docs lua_ls = { on_init = function(client) @@ -824,11 +829,18 @@ do -- You can also specify external formatters in here. formatters_by_ft = { lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - python = { 'isort', 'black' }, + -- ruff handles BOTH import-sorting and formatting (black/isort are not + -- installed; ruff is). Organize imports first, then format. + python = { 'ruff_organize_imports', 'ruff_format' }, -- You can use 'stop_after_first' to run the first available formatter from the list javascript = { 'prettierd', 'prettier', stop_after_first = true }, - SQL = { 'sql-formatter' }, + -- conform matches the lowercase `vim.bo.filetype`, so the key must be `sql` + -- (an uppercase `SQL` key would never fire). + sql = { 'sql-formatter' }, + -- Wire in installed-but-previously-unused Mason tools: + java = { 'google-java-format' }, + tex = { 'latexindent' }, + plaintex = { 'latexindent' }, }, } From 4f0c0471cd2fc6309d81507ebb1695c714e4f9f0 Mon Sep 17 00:00:00 2001 From: HuNtErJ1324 Date: Sun, 21 Jun 2026 15:17:23 -0700 Subject: [PATCH 3/4] Finish wiring up nvim-java (jdtls bootstrap) nvim-java was installed but never initialized, so jdtls ran vanilla and the plugin's value-add (tests, DAP, refactors, Spring Boot) was inert. Wire it up following the current nvim-java README (Neovim 0.11.5+ / vim.pack install): - lua/custom/plugins/nvim-java.lua now installs the full stack (spring-boot.nvim pinned, nui.nvim, nvim-dap, nvim-java), calls `require('java').setup()` and then `vim.lsp.enable('jdtls')`, in that required order. - init.lua: the LSP config/enable loop now SKIPS jdtls, so nvim-java is the single owner of jdtls configuration and enablement. This avoids a second, competing vanilla jdtls setup while jdtls stays in the `servers` table purely so mason-tool-installer keeps it installed. - java-debug-adapter + java-test remain provided via mason-nvim-dap (debug.lua), giving nvim-java the bundles it launches jdtls with for DAP and tests. Verified headless: opening a .java buffer attaches exactly one jdtls client (plus spring-boot), with no duplicate/competing jdtls setup and no Lua errors. Co-Authored-By: Claude Opus 4.8 --- init.lua | 15 ++++++++++++--- lua/custom/plugins/nvim-java.lua | 32 +++++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 9c996d2cf28..76ca95d52aa 100644 --- a/init.lua +++ b/init.lua @@ -706,7 +706,11 @@ do stylua = {}, -- Used to format Lua code - -- Java language server (installed via Mason). + -- Java: jdtls is installed via Mason (it's a key here so mason-tool-installer + -- picks it up), but its LSP config and `vim.lsp.enable` are owned by nvim-java + -- (see lua/custom/plugins/nvim-java.lua). We therefore SKIP jdtls in the + -- config/enable loop below so nvim-java's jdtls bootstrap is the one that wins + -- and there is no competing vanilla jdtls setup. jdtls = {}, -- ty: Astral's Python type checker. Not yet shipped by nvim-lspconfig, so we @@ -797,8 +801,13 @@ do require('mason-tool-installer').setup { ensure_installed = ensure_installed } for name, server in pairs(servers) do - vim.lsp.config(name, server) - vim.lsp.enable(name) + -- jdtls is configured and enabled by nvim-java (lua/custom/plugins/nvim-java.lua), + -- which must run `require('java').setup()` before `vim.lsp.enable('jdtls')`. + -- Skip it here to avoid a second, competing jdtls setup. + if name ~= 'jdtls' then + vim.lsp.config(name, server) + vim.lsp.enable(name) + end end end diff --git a/lua/custom/plugins/nvim-java.lua b/lua/custom/plugins/nvim-java.lua index c77d807eb0b..452a1a39eec 100644 --- a/lua/custom/plugins/nvim-java.lua +++ b/lua/custom/plugins/nvim-java.lua @@ -1,7 +1,29 @@ --- nvim-java: Java IDE layer on top of jdtls. +-- nvim-java: full Java IDE layer on top of jdtls (tests, DAP, refactors, Spring Boot). -- https://github.com/nvim-java/nvim-java -- --- NOTE: This only installs the plugin (mirroring the user's original --- `return { 'nvim-java/nvim-java' }` spec). It is NOT yet initialized, so jdtls --- currently runs vanilla. Wiring (`require('java').setup()`) is finished later. -vim.pack.add { 'https://github.com/nvim-java/nvim-java' } +-- This file is loaded by the custom-plugins loader (lua/custom/plugins/init.lua), +-- which runs in Section 10 of init.lua -- AFTER the LSP section (Section 6). The LSP +-- section deliberately SKIPS jdtls in its `vim.lsp.config`/`vim.lsp.enable` loop, so +-- this is the single place jdtls is configured and enabled. That guarantees the +-- required order (`require('java').setup()` before `vim.lsp.enable('jdtls')`) and +-- avoids a second, competing vanilla jdtls setup. +-- +-- Requirements (nvim-java README, vim.pack install): Neovim 0.11.5+. jdtls, +-- java-debug-adapter and java-test are provided via Mason -- jdtls from the LSP +-- section's mason-tool-installer, java-debug-adapter + java-test from +-- lua/kickstart/plugins/debug.lua (mason-nvim-dap). nvim-dap and nui.nvim are also +-- pulled in by debug.lua / neo-tree.lua respectively; re-listing them here is +-- idempotent and keeps this spec self-contained per the README. +vim.pack.add { + { src = 'https://github.com/JavaHello/spring-boot.nvim', version = '218c0c26c14d99feca778e4d13f5ec3e8b1b60f0' }, + 'https://github.com/MunifTanjim/nui.nvim', + 'https://github.com/mfussenegger/nvim-dap', + 'https://github.com/nvim-java/nvim-java', +} + +-- Must run BEFORE jdtls is enabled: it patches the jdtls config so the language +-- server is launched with the java-test / java-debug-adapter bundles. +require('java').setup() + +-- Enable jdtls using the config nvim-java just registered (the new Neovim 0.11+ API). +vim.lsp.enable 'jdtls' From 64fe673c479c2e9701d1f0b64ae11fc508182032 Mon Sep 17 00:00:00 2001 From: HuNtErJ1324 Date: Sun, 21 Jun 2026 15:47:38 -0700 Subject: [PATCH 4/4] Fix conform SQL formatter id: sql-formatter -> sql_formatter `sql-formatter` is the Mason/executable name, not a conform formatter id, so conform found no such formatter and SQL formatting silently failed. conform ships `lua/conform/formatters/sql_formatter.lua` (id `sql_formatter`, whose `command = 'sql-formatter'`). Use the underscore id. Verified headless: `require('conform').list_formatters(0)` on an sql buffer reports `name=sql_formatter available=true command=sql-formatter`. Co-Authored-By: Claude Opus 4.8 --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 76ca95d52aa..9f0c796986e 100644 --- a/init.lua +++ b/init.lua @@ -844,8 +844,9 @@ do -- You can use 'stop_after_first' to run the first available formatter from the list javascript = { 'prettierd', 'prettier', stop_after_first = true }, -- conform matches the lowercase `vim.bo.filetype`, so the key must be `sql` - -- (an uppercase `SQL` key would never fire). - sql = { 'sql-formatter' }, + -- (an uppercase `SQL` key would never fire). The formatter id is + -- `sql_formatter` (conform's name); it wraps the `sql-formatter` executable. + sql = { 'sql_formatter' }, -- Wire in installed-but-previously-unused Mason tools: java = { 'google-java-format' }, tex = { 'latexindent' },