From 632f8682dbaa1b08e22319b133cc13bdd8a32c79 Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 10:44:18 -0700 Subject: [PATCH 01/10] feat(nvim): add Rust support via rustaceanvim rustaceanvim owns rust-analyzer (from rustup) with clippy as the on-save check, buffer-local r maps for runnables, testables, debuggables and macro expansion, the rust treesitter parser, and rustfmt via conform. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/init.lua | 1 + dot_config/nvim/lazy-lock.json | 1 + dot_config/nvim/lua/custom/plugins/rust.lua | 60 +++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 dot_config/nvim/lua/custom/plugins/rust.lua diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 6bebce4..e9ca599 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1874,6 +1874,7 @@ require('lazy').setup({ 'mermaid', 'powershell', 'query', + 'rust', 'thrift', 'toml', 'tsx', diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json index 3bf4a85..63a9a20 100644 --- a/dot_config/nvim/lazy-lock.json +++ b/dot_config/nvim/lazy-lock.json @@ -30,6 +30,7 @@ "nvim-web-devicons": { "branch": "master", "commit": "0dc0cfb0c6858041174a53c7aa4adaf65e994b3c" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "render-markdown.nvim": { "branch": "main", "commit": "a67f826164c38c836fc6060f32b275c4c43317a7" }, + "rustaceanvim": { "branch": "main", "commit": "b7ca983c6ec88c94cf25e5deaad96df9a68b9a98" }, "smear-cursor.nvim": { "branch": "main", "commit": "f6cb57c342268177f719acc3968b9d8de3ecc969" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, diff --git a/dot_config/nvim/lua/custom/plugins/rust.lua b/dot_config/nvim/lua/custom/plugins/rust.lua new file mode 100644 index 0000000..80bfd97 --- /dev/null +++ b/dot_config/nvim/lua/custom/plugins/rust.lua @@ -0,0 +1,60 @@ +-- Rust: rustaceanvim owns rust-analyzer (do not also enable `rust_analyzer` +-- through vim.lsp.enable). rust-analyzer comes from rustup: +-- rustup component add rust-analyzer rust-src +return { + { + 'mrcjkb/rustaceanvim', + version = '^9', + lazy = false, -- the plugin lazy-loads itself on the rust filetype + init = function() + -- A function so blink.cmp is only required when the first Rust buffer opens. + vim.g.rustaceanvim = function() + return { + server = { + capabilities = require('blink.cmp').get_lsp_capabilities(), + on_attach = function(_, bufnr) + local map = function(lhs, rhs, desc) vim.keymap.set('n', lhs, rhs, { buffer = bufnr, desc = desc }) end + + map('rr', function() vim.cmd.RustLsp 'runnables' end, 'Rust: runnables') + map('rR', function() vim.cmd.RustLsp { 'runnables', bang = true } end, 'Rust: rerun last runnable') + map('rt', function() vim.cmd.RustLsp 'testables' end, 'Rust: testables') + map('rd', function() vim.cmd.RustLsp 'debuggables' end, 'Rust: debuggables') + map('rm', function() vim.cmd.RustLsp 'expandMacro' end, 'Rust: expand macro') + map('re', function() vim.cmd.RustLsp 'explainError' end, 'Rust: explain error') + map('rD', function() vim.cmd.RustLsp 'renderDiagnostic' end, 'Rust: render diagnostic') + map('rc', function() vim.cmd.RustLsp 'openCargo' end, 'Rust: open Cargo.toml') + map('rp', function() vim.cmd.RustLsp 'parentModule' end, 'Rust: parent module') + map('rj', function() vim.cmd.RustLsp 'joinLines' end, 'Rust: join lines') + map('K', function() vim.cmd.RustLsp { 'hover', 'actions' } end, 'Rust: hover actions') + end, + default_settings = { + ['rust-analyzer'] = { + -- Run clippy instead of `cargo check` on save. + check = { command = 'clippy' }, + cargo = { allFeatures = true }, + procMacro = { enable = true }, + }, + }, + }, + } + end + end, + }, + + { + 'folke/which-key.nvim', + optional = true, + opts = function(_, opts) + opts.spec = opts.spec or {} + table.insert(opts.spec, { 'r', group = '[R]ust/Cargo' }) + end, + }, + + { + 'stevearc/conform.nvim', + opts = function(_, opts) + opts.formatters_by_ft = opts.formatters_by_ft or {} + opts.formatters_by_ft.rust = { 'rustfmt' } + end, + }, +} From f809e95848f5f752c406274755cffc27b9f0ff80 Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 10:46:34 -0700 Subject: [PATCH 02/10] feat(nvim): add Cargo.toml support with crates.nvim and taplo crates.nvim runs as an in-process language server on Cargo.toml for version and feature completion, hover and code actions. taplo covers all TOML buffers; toml is excluded from format-on-save so hand-edited files only reformat on f. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/init.lua | 7 ++++++- dot_config/nvim/lazy-lock.json | 1 + dot_config/nvim/lua/custom/plugins/rust.lua | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index e9ca599..fda6b26 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1289,6 +1289,8 @@ require('lazy').setup({ end, }, markdown_oxide = {}, + -- TOML (Cargo.toml, mise.toml, ...): schema-aware completion and formatting. + taplo = {}, } -- Built, registered, and enabled on the first Kotlin buffer (or Kotlin @@ -1378,6 +1380,7 @@ require('lazy').setup({ 'ktlint', 'dart-debug-adapter', 'markdown-oxide', + 'taplo', 'tree-sitter-cli', } @@ -1654,7 +1657,9 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + -- toml: taplo would reformat every hand-edited TOML file on save; + -- format those explicitly with f instead. + local disable_filetypes = { c = true, cpp = true, toml = true } if disable_filetypes[vim.bo[bufnr].filetype] then return nil else diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json index 63a9a20..d315fc3 100644 --- a/dot_config/nvim/lazy-lock.json +++ b/dot_config/nvim/lazy-lock.json @@ -4,6 +4,7 @@ "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "codecompanion.nvim": { "branch": "main", "commit": "14b4993a24fac8bb122ce524e25bb0f7f392afd6" }, "conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" }, + "crates.nvim": { "branch": "main", "commit": "afcd1cc3eeceb5783676fc8464389b9216a29d05" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "fidget.nvim": { "branch": "main", "commit": "9e0201673e08e997e7cf52afca5565c70bd117f3" }, "gitlinker.nvim": { "branch": "master", "commit": "e035542b103876f7ecafaf5c7f1ff4764ca6ff55" }, diff --git a/dot_config/nvim/lua/custom/plugins/rust.lua b/dot_config/nvim/lua/custom/plugins/rust.lua index 80bfd97..0d17a9d 100644 --- a/dot_config/nvim/lua/custom/plugins/rust.lua +++ b/dot_config/nvim/lua/custom/plugins/rust.lua @@ -41,6 +41,23 @@ return { end, }, + { + -- Crate versions, features and docs inside Cargo.toml, served through an + -- in-process language server so completion reaches blink.cmp and code + -- actions show up under gra. + 'saecki/crates.nvim', + version = '^0.7', + event = { 'BufRead Cargo.toml' }, + opts = { + lsp = { + enabled = true, + actions = true, + completion = true, + hover = true, + }, + }, + }, + { 'folke/which-key.nvim', optional = true, From 78cba74a90823b3ad30760ef54488a664658c4c9 Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 10:47:43 -0700 Subject: [PATCH 03/10] feat(nvim): enable DAP for Rust and TypeScript Turn on kickstart's debug module. mason-nvim-dap installs codelldb, which rustaceanvim picks up for :RustLsp debuggables, and js-debug-adapter, wired as pwa-node/pwa-chrome with launch, tsx, and attach configurations for JS/TS buffers. delve stays out of ensure_installed because it needs a newer Go than is installed. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/init.lua | 2 +- dot_config/nvim/lazy-lock.json | 4 + .../nvim/lua/kickstart/plugins/debug.lua | 83 +++++++++++++++++-- 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index fda6b26..c757878 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1953,7 +1953,7 @@ require('lazy').setup({ -- 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.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json index d315fc3..977b64f 100644 --- a/dot_config/nvim/lazy-lock.json +++ b/dot_config/nvim/lazy-lock.json @@ -15,6 +15,7 @@ "jj.nvim": { "branch": "main", "commit": "9b1dca730f459b664f8a03f93e0d282693d7d5f8" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, "mini.nvim": { "branch": "main", "commit": "b8a0af521530f8ee68c738657429eab59de6a2ae" }, @@ -23,6 +24,9 @@ "neotest-python": { "branch": "master", "commit": "1b56ca4ba51c6014f986d6548ee629bdc95589d1" }, "neotest-vitest": { "branch": "main", "commit": "b0c265743c877058068dbc40d104ea5d40e6b257" }, "nvim-allium": { "branch": "main", "commit": "ae0bade344973347f695991f15dfe76ea0299253" }, + "nvim-dap": { "branch": "master", "commit": "cfa2d58f4537aca6ca83e2de1a0d9f1491121264" }, + "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, + "nvim-dap-ui": { "branch": "master", "commit": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43" }, "nvim-lint": { "branch": "master", "commit": "6bf29b9dbdad60b38b489b23309c22ba6d4c915a" }, "nvim-lspconfig": { "branch": "master", "commit": "4648fd8ba5c678d7e2db75ae44ffac269bb589d8" }, "nvim-nio": { "branch": "master", "commit": "edcc181a875301dd21840189aa2f2f9ad69fc172" }, diff --git a/dot_config/nvim/lua/kickstart/plugins/debug.lua b/dot_config/nvim/lua/kickstart/plugins/debug.lua index 1e3570f..2d3a00f 100644 --- a/dot_config/nvim/lua/kickstart/plugins/debug.lua +++ b/dot_config/nvim/lua/kickstart/plugins/debug.lua @@ -74,13 +74,21 @@ return { -- You can provide additional configuration to the handlers, -- see mason-nvim-dap README for more information - handlers = {}, + handlers = { + function(config) require('mason-nvim-dap').default_setup(config) end, + -- rustaceanvim registers codelldb itself (`:RustLsp debuggables`). + codelldb = function() end, + -- js-debug is configured below; mason-nvim-dap has no default for it. + js = function() end, + }, - -- You'll need to check that you have the required things installed - -- online, please don't ask me how to install them :) + -- mason-nvim-dap source names (not mason package names). + -- delve is left out: current delve needs a newer Go than mise pins, and + -- a failed install errors on every load. `:MasonInstall delve` once Go + -- is upgraded. ensure_installed = { - -- Update this to ensure that you have the debuggers for the langs you want - 'delve', + 'codelldb', + 'js', }, } @@ -122,6 +130,71 @@ return { dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close + -- JavaScript / TypeScript via vscode-js-debug (mason `js-debug-adapter`). + -- The mason shim starts the DAP server on the port nvim-dap picks. + for _, adapter in ipairs { 'pwa-node', 'pwa-chrome' } do + dap.adapters[adapter] = { + type = 'server', + host = 'localhost', + port = '${port}', + executable = { command = 'js-debug-adapter', args = { '${port}' } }, + } + end + + local js_configurations = { + { + type = 'pwa-node', + request = 'launch', + name = 'Node: launch current file', + program = '${file}', + cwd = '${workspaceFolder}', + sourceMaps = true, + }, + { + -- TypeScript without a build step; needs `tsx` in the project or on npx. + type = 'pwa-node', + request = 'launch', + name = 'Node: launch current file with tsx', + runtimeExecutable = 'npx', + runtimeArgs = { 'tsx' }, + program = '${file}', + cwd = '${workspaceFolder}', + sourceMaps = true, + skipFiles = { '/**', '**/node_modules/**' }, + }, + { + type = 'pwa-node', + request = 'attach', + name = 'Node: attach to process', + processId = require('dap.utils').pick_process, + cwd = '${workspaceFolder}', + sourceMaps = true, + }, + { + -- Pairs with `node --inspect` (or `--inspect-brk`) on the default port. + type = 'pwa-node', + request = 'attach', + name = 'Node: attach to :9229', + port = 9229, + cwd = '${workspaceFolder}', + sourceMaps = true, + }, + { + type = 'pwa-chrome', + request = 'launch', + name = 'Chrome: launch localhost:3000', + url = function() + local url = vim.fn.input('URL: ', 'http://localhost:3000') + return url ~= '' and url or dap.ABORT + end, + webRoot = '${workspaceFolder}', + sourceMaps = true, + }, + } + for _, ft in ipairs { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' } do + dap.configurations[ft] = js_configurations + end + -- Install golang specific config require('dap-go').setup { delve = { From dd72f7b32d2f856eeff2f8a9287347ddbbd0ae74 Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 10:49:14 -0700 Subject: [PATCH 04/10] feat(nvim): add Rust and Jest neotest adapters rustaceanvim's adapter covers cargo tests and neotest-jest covers Jest projects next to vitest. New maps run the nearest test, rerun the last, debug the nearest via DAP, toggle the summary, and stop a run. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/init.lua | 10 ++++++++++ dot_config/nvim/lazy-lock.json | 1 + 2 files changed, 11 insertions(+) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index c757878..cd1a923 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1612,6 +1612,11 @@ require('lazy').setup({ { 'tf', function() require('neotest').run.run(vim.fn.expand '%:p') end, desc = 'Run test file' }, { 'to', function() require('neotest').output.open() end, desc = 'Test output' }, { 'tO', function() require('neotest').output_panel.toggle() end, desc = 'Test panel' }, + { 'tr', function() require('neotest').run.run() end, desc = 'Run nearest test' }, + { 'tl', function() require('neotest').run.run_last() end, desc = 'Rerun last test' }, + { 'td', function() require('neotest').run.run { strategy = 'dap' } end, desc = 'Debug nearest test' }, + { 'ts', function() require('neotest').summary.toggle() end, desc = 'Test summary' }, + { 'tS', function() require('neotest').run.stop() end, desc = 'Stop test run' }, }, dependencies = { 'nvim-neotest/nvim-nio', @@ -1620,6 +1625,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', 'nvim-neotest/neotest-python', 'marilari88/neotest-vitest', + 'nvim-neotest/neotest-jest', }, config = function() local neotest = require 'neotest' @@ -1634,6 +1640,10 @@ require('lazy').setup({ -- pytest_command = { 'python3', '-m', 'pytest' }, }, require 'neotest-vitest', + -- Only claims files in projects that depend on jest. + require 'neotest-jest' {}, + -- Provided by rustaceanvim (do not also add neotest-rust). + require 'rustaceanvim.neotest', }, } end, diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json index 977b64f..e4294f7 100644 --- a/dot_config/nvim/lazy-lock.json +++ b/dot_config/nvim/lazy-lock.json @@ -21,6 +21,7 @@ "mini.nvim": { "branch": "main", "commit": "b8a0af521530f8ee68c738657429eab59de6a2ae" }, "neogit": { "branch": "master", "commit": "17929b7b0b9c05fe3dfc788fbba9881eb9c1cbec" }, "neotest": { "branch": "master", "commit": "27bf921498043f7ecd821d6db68d05de244bbd02" }, + "neotest-jest": { "branch": "main", "commit": "0e7979d51301dfae5ef839d771bd28cf593fde3f" }, "neotest-python": { "branch": "master", "commit": "1b56ca4ba51c6014f986d6548ee629bdc95589d1" }, "neotest-vitest": { "branch": "main", "commit": "b0c265743c877058068dbc40d104ea5d40e6b257" }, "nvim-allium": { "branch": "main", "commit": "ae0bade344973347f695991f15dfe76ea0299253" }, From 4be75f811cce552218f466b0a216aaede2eca702 Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 10:50:45 -0700 Subject: [PATCH 05/10] feat(nvim): use the ESLint language server for JS/TS eslint_d only produced diagnostics through nvim-lint. The eslint server runs the project's own eslint and also offers its fixes as code actions, with cE for LspEslintFixAll. nvim-lint keeps the prose linters. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/init.lua | 4 +++- .../nvim/lua/custom/plugins/typescript.lua | 24 ++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index cd1a923..7c41412 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1267,6 +1267,8 @@ require('lazy').setup({ yamlls = {}, html = {}, cssls = {}, + -- Diagnostics and fix-all code actions; uses the project's eslint. + eslint = {}, pyright = { settings = { python = { @@ -1392,7 +1394,7 @@ require('lazy').setup({ 'html-lsp', 'css-lsp', 'typescript-language-server', - 'eslint_d', + 'eslint-lsp', 'prettierd', }) end diff --git a/dot_config/nvim/lua/custom/plugins/typescript.lua b/dot_config/nvim/lua/custom/plugins/typescript.lua index f0d5bcf..9964225 100644 --- a/dot_config/nvim/lua/custom/plugins/typescript.lua +++ b/dot_config/nvim/lua/custom/plugins/typescript.lua @@ -6,6 +6,18 @@ return { 'neovim/nvim-lspconfig', }, ft = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' }, + init = function() + -- The eslint server comes from vim.lsp.enable in init.lua; its + -- LspEslintFixAll command is buffer-local, so map it on attach. + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('eslint-attach', { clear = true }), + callback = function(event) + local client = vim.lsp.get_client_by_id(event.data.client_id) + if not client or client.name ~= 'eslint' then return end + vim.keymap.set('n', 'cE', 'LspEslintFixAll', { buffer = event.buf, desc = 'ESLint: fix all' }) + end, + }) + end, config = function() require('typescript-tools').setup { settings = { @@ -67,10 +79,8 @@ return { config = function() local lint = require 'lint' lint.linters_by_ft = lint.linters_by_ft or {} - lint.linters_by_ft.javascript = { 'eslint_d' } - lint.linters_by_ft.javascriptreact = { 'eslint_d' } - lint.linters_by_ft.typescript = { 'eslint_d' } - lint.linters_by_ft.typescriptreact = { 'eslint_d' } + -- JS/TS: ESLint runs as a language server (see `eslint` in init.lua), + -- which also supplies its fixes as code actions. -- Prose: Vale (on PATH via mise). markdownlint removed in favour of Vale rules. lint.linters_by_ft.markdown = { 'vale' } @@ -78,16 +88,12 @@ return { lint.linters_by_ft.rst = { 'vale' } local lint_autocmd_ft = { - javascript = true, - javascriptreact = true, - typescript = true, - typescriptreact = true, markdown = true, text = true, rst = true, } - local lint_augroup = vim.api.nvim_create_augroup('lint-typescript', { clear = true }) + local lint_augroup = vim.api.nvim_create_augroup('lint-prose', { clear = true }) vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, callback = function() From ac265574e89c401802f5cf19e99ed38b0946fdd4 Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 10:52:05 -0700 Subject: [PATCH 06/10] feat(nvim): add SchemaStore schemas to jsonls and yamlls package.json, tsconfig.json, GitHub workflow and other config files now get completion and validation. The catalog is required from before_init, so it only loads when a JSON or YAML server starts. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/init.lua | 20 ++++++++++++++++++-- dot_config/nvim/lazy-lock.json | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 7c41412..a38fd15 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1037,6 +1037,11 @@ require('lazy').setup({ }, -- LSP Plugins + -- JSON/YAML schemas (package.json, tsconfig.json, GitHub workflows, ...). + -- Not an lspconfig dependency: lazy.nvim loads it on the first + -- require('schemastore') from the jsonls/yamlls before_init hooks. + { 'b0o/SchemaStore.nvim', lazy = true, version = false }, + { -- Main LSP Configuration 'neovim/nvim-lspconfig', @@ -1263,8 +1268,19 @@ require('lazy').setup({ local servers = { gopls = {}, - jsonls = {}, - yamlls = {}, + jsonls = { + settings = { json = { validate = { enable = true } } }, + before_init = function(_, config) config.settings.json.schemas = require('schemastore').json.schemas() end, + }, + yamlls = { + settings = { + yaml = { + -- Use SchemaStore.nvim's catalog instead of yamlls's own download. + schemaStore = { enable = false, url = '' }, + }, + }, + before_init = function(_, config) config.settings.yaml.schemas = require('schemastore').yaml.schemas() end, + }, html = {}, cssls = {}, -- Diagnostics and fix-all code actions; uses the project's eslint. diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json index e4294f7..9ad8ec7 100644 --- a/dot_config/nvim/lazy-lock.json +++ b/dot_config/nvim/lazy-lock.json @@ -1,6 +1,7 @@ { "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" }, + "SchemaStore.nvim": { "branch": "main", "commit": "b3025386000bbaacb3d63565011f33e726084116" }, "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "codecompanion.nvim": { "branch": "main", "commit": "14b4993a24fac8bb122ce524e25bb0f7f392afd6" }, "conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" }, From a1fb52ce14ee9dd183e53d7d04e6a7a74a319aef Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 10:53:14 -0700 Subject: [PATCH 07/10] feat(nvim): format and lint with Biome in Biome projects When a biome.json[c] sits above the buffer, conform formats JS/TS with biome instead of prettier, and the biome language server attaches for diagnostics. Projects without a Biome config are unchanged. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/init.lua | 3 +++ dot_config/nvim/lua/custom/plugins/typescript.lua | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index a38fd15..dec9cad 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1285,6 +1285,8 @@ require('lazy').setup({ cssls = {}, -- Diagnostics and fix-all code actions; uses the project's eslint. eslint = {}, + -- Only attaches where a biome.json[c] exists; prefers node_modules/.bin/biome. + biome = {}, pyright = { settings = { python = { @@ -1411,6 +1413,7 @@ require('lazy').setup({ 'css-lsp', 'typescript-language-server', 'eslint-lsp', + 'biome', 'prettierd', }) end diff --git a/dot_config/nvim/lua/custom/plugins/typescript.lua b/dot_config/nvim/lua/custom/plugins/typescript.lua index 9964225..1230f19 100644 --- a/dot_config/nvim/lua/custom/plugins/typescript.lua +++ b/dot_config/nvim/lua/custom/plugins/typescript.lua @@ -51,10 +51,15 @@ return { 'stevearc/conform.nvim', opts = function(_, opts) opts.formatters_by_ft = opts.formatters_by_ft or {} - opts.formatters_by_ft.javascript = { 'prettierd', 'prettier', stop_after_first = true } - opts.formatters_by_ft.javascriptreact = { 'prettierd', 'prettier', stop_after_first = true } - opts.formatters_by_ft.typescript = { 'prettierd', 'prettier', stop_after_first = true } - opts.formatters_by_ft.typescriptreact = { 'prettierd', 'prettier', stop_after_first = true } + -- Biome projects (biome.json[c] above the file) format with biome; + -- everything else keeps prettier. + local function js_formatters(bufnr) + if vim.fs.root(bufnr, { 'biome.json', 'biome.jsonc' }) then return { 'biome' } end + return { 'prettierd', 'prettier', stop_after_first = true } + end + for _, ft in ipairs { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' } do + opts.formatters_by_ft[ft] = js_formatters + end local previous = opts.format_on_save opts.format_on_save = function(bufnr) From 46848abb297142f091655fed5b4913857c81b8c8 Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 10:56:35 -0700 Subject: [PATCH 08/10] chore(nvim): stop installing typescript-language-server typescript-tools talks to tsserver directly and ts_ls is never enabled, so the mason package was an unused install. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index dec9cad..e79091e 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1411,7 +1411,6 @@ require('lazy').setup({ 'json-lsp', 'html-lsp', 'css-lsp', - 'typescript-language-server', 'eslint-lsp', 'biome', 'prettierd', From 8359584ac8a260e18fdbafc594ddc67a02045e48 Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 11:13:52 -0700 Subject: [PATCH 09/10] perf(nvim): skip rustaceanvim's PATH probe for cargo-nextest rustaceanvim checks vim.fn.executable('cargo-nextest') while building its defaults, before user config is merged. When nextest is absent on WSL that walks every /mnt/c PATH entry, adding about 120 ms to the first Rust buffer. A package.preload hook answers that one lookup with a stat of $CARGO_HOME/bin for the duration of the module load. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/lua/custom/plugins/rust.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dot_config/nvim/lua/custom/plugins/rust.lua b/dot_config/nvim/lua/custom/plugins/rust.lua index 0d17a9d..61fae43 100644 --- a/dot_config/nvim/lua/custom/plugins/rust.lua +++ b/dot_config/nvim/lua/custom/plugins/rust.lua @@ -7,6 +7,26 @@ return { version = '^9', lazy = false, -- the plugin lazy-loads itself on the rust filetype init = function() + -- rustaceanvim probes PATH for cargo-nextest while building its + -- defaults (config/internal.lua), before vim.g.rustaceanvim is merged, + -- so `tools.enable_nextest` cannot skip it. On WSL a miss walks every + -- /mnt/c PATH entry (~80 ms on the first .rs buffer). Answer from + -- cargo's bin dir instead, for this one module load only. If the plugin + -- renames the module this hook never fires and the slow probe returns. + package.preload['rustaceanvim.config.internal'] = function(modname) + local path = vim.api.nvim_get_runtime_file('lua/rustaceanvim/config/internal.lua', false)[1] + local executable = vim.fn.executable + vim.fn.executable = function(name) + if name ~= 'cargo-nextest' then return executable(name) end + local cargo_home = vim.env.CARGO_HOME or (vim.env.HOME .. '/.cargo') + return vim.uv.fs_stat(cargo_home .. '/bin/cargo-nextest') and 1 or 0 + end + local ok, mod = pcall(function() return assert(loadfile(path))(modname) end) + vim.fn.executable = executable -- restored even if the load failed + if not ok then error(mod, 0) end + return mod + end + -- A function so blink.cmp is only required when the first Rust buffer opens. vim.g.rustaceanvim = function() return { From 34886f549985a1352dfc00bf1f440535388d1535 Mon Sep 17 00:00:00 2001 From: aguil Date: Sun, 29 Nov 2026 11:22:06 -0700 Subject: [PATCH 10/10] perf(nvim): stat mason's tree-sitter instead of searching PATH The parser-install guard called vim.fn.executable('tree-sitter') on every startup. Mason's bin dir is often not on PATH yet at that point, so on WSL the search walked the /mnt/c entries before reaching a mise shim, adding 65-125 ms to roughly half of all startups. Check mason's copy with fs_stat first and search PATH only when it is missing. Co-Authored-By: Claude Opus 5.5 --- dot_config/nvim/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index e79091e..1ececea 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1963,7 +1963,12 @@ require('lazy').setup({ {} ) - if vim.fn.executable 'tree-sitter' == 1 then require('nvim-treesitter').install(parsers) end + -- mason installs tree-sitter-cli, but its bin dir is often not on PATH + -- yet when this runs, so a PATH search walks the slow /mnt/c entries + -- on WSL before reaching a mise shim (~65-125 ms per startup). Stat + -- mason's copy first; search PATH only when mason does not have one. + local mason_tree_sitter = vim.fn.stdpath 'data' .. '/mason/bin/tree-sitter' + if vim.uv.fs_stat(mason_tree_sitter) or vim.fn.executable 'tree-sitter' == 1 then require('nvim-treesitter').install(parsers) end vim.api.nvim_create_autocmd('FileType', { pattern = filetypes, callback = function() pcall(vim.treesitter.start) end,