nvim: reduce startup cost — lazy-load rust, scope ccc/lint triggers, consolidate mini, web LSP root_dir guards#1
Merged
Conversation
…ni.nvim - rustaceanvim: lazy = false → ft = "rust" (only loads on Rust files) - ccc.nvim: global BufReadPost/BufNewFile → ft scoped to CSS/HTML/JS family - nvim-lint: remove BufReadPost from inner autocmd; lint on BufWritePost + InsertLeave only - mini.nvim: collapse 9 separate module specs into one consolidated spec - ts_ls, emmet_ls, tailwindcss: add root_dir scoping via vim.fs.root to prevent attaching in non-web projects
Copilot created this pull request from a session on behalf of
Gerrrt
June 2, 2026 02:58
View session
There was a problem hiding this comment.
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+6
to
+12
| return vim.fs.root(fname, { | ||
| "tailwind.config.js", | ||
| "tailwind.config.ts", | ||
| "tailwind.config.mjs", | ||
| "postcss.config.js", | ||
| "postcss.config.ts", | ||
| }) |
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.
Several plugins were loading or triggering unconditionally on every startup or file open. This addresses the worst offenders.
Changes
rustaceanvim —
lazy = false→ft = "rust". rust-analyzer was spawning on every Neovim startup regardless of filetype.ccc.nvim — replaced global
BufReadPost/BufNewFileevent withft = { "css", "scss", "html", "javascript", ... }. Color highlighter was attaching virtual text to every buffer.nvim-lint — removed
BufReadPostfrom the inner autocmd (was also in plugin load event, causing redundant lint runs on every buffer switch). Now triggers onBufWritePost+InsertLeaveonly.mini.nvim — collapsed 9 separate per-module specs into a single
echasnovski/mini.nvimspec. Reduces lazy.nvim lockfile entries and update checks; all modules still initialized viaconfig.ts_ls / emmet_ls / tailwindcss — added
root_dirguards usingvim.fs.root. Servers were attaching to any matching filetype system-wide; now require project markers:ts_ls:tsconfig.json,jsconfig.json, orpackage.jsonemmet_ls:package.jsonor.gittailwindcss:tailwind.config.{js,ts,mjs}orpostcss.config.{js,ts}